wood burning stoves 2.0*
The moose likes Java in General and the fly likes nslookup Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "nslookup" Watch "nslookup" New topic


Peter Straw
Ranch Hand

Joined: Jan 08, 2002
Posts: 79
I am currently using this code to test the validity of a domain name:-
String ipAddress = InetAddress.getByName("www.yahoo.com").getHostAddress();String hostName = InetAddress.getByName("").getHostName();
Is it possible to set the type (like you would do with a command line nslookup) to mx, so that it tests for mail servers only?
Many thanks
Marcus Howarth
Ranch Hand

Joined: Jan 04, 2002
Posts: 37
Could you use InetSocketAddress and try the common ports for mail?

Marcus<br /> <br />SCJP, March '02
Consider Paul's rocket mass heater.
subject: nslookup