File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

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