19Sep/090
Domain Lookup
Here is some code to do domain lookup in java (nslookup style):
Hashtable env = new Hashtable();
env.put("java.naming.factory.initial", "com.sun.jndi.dns.DnsContextFactory");
DirContext ictx = new InitialDirContext(env);
Attributes attrs = ictx.getAttributes("gmail.com", new String[]{"MX"});
Attribute attr = attrs.get("MX");