This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
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 Java Interview Guide this week in the Jobs Discussion 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("").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: 38

Could you use InetSocketAddress and try the common ports for mail?


SCJP, March '02
I agree. Here's the link:
subject: nslookup
It's not a secret anymore!