tags:

views:

60

answers:

1

I am reading about SURBLs (known spam hosts), for purpose of classifying spam, as a batch process. Main access method seems to be via DNS lookups. I was wondering what's the usual way to do such lookups from Java code. Since this is a batch process with no strict performance requirements, I think most important feature would just be simplicity.

+1  A: 

You could simply do:

InetAddress.getByName("test.multi.surbl.org").getHostAddress();

If the hostname can not be resolved, it's not listed. If it can be resolved, the last octet of the ip address indicates where it's listed.

There's also dnsjava if you need more advanced features. For example, perhaps you would like to check the TXT record too.

Martin
Very good, thanks!
StaxMan