This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Other JSE/JEE APIs and the fly likes Convert IP to FQDN Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "Convert IP to FQDN" Watch "Convert IP to FQDN" New topic
Author

Convert IP to FQDN

Viralraj Upadhyay
Greenhorn

Joined: Nov 10, 2006
Posts: 22
I have a DNS configured for IP to FQDN mapping. Here's a code to accept IP and print the FQDN

getCanonicalHostName() above returns the correct FQDN for all nodes except one for which it returns the hostname (name) of the machine. Why would that happen?
[ December 31, 2008: Message edited by: Raj Upadhyay ]
Viralraj Upadhyay
Greenhorn

Joined: Nov 10, 2006
Posts: 22
okay this is resolved. Had to change the /etc/nsswitch.conf to have host name search path "dns" as the first entry.
 
 
subject: Convert IP to FQDN
 
Similar Threads
How to get computer name?
Getting the Client machine name
Problem Using Sockets and BufferedReader
How to configure Tomcat to resolve host names
How to get own ip Address: