Forums Register Login

Convert IP to FQDN

+Pie Number of slices to send: Send
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 ]
+Pie Number of slices to send: Send
okay this is resolved. Had to change the /etc/nsswitch.conf to have host name search path "dns" as the first entry.
them good ole boys were drinking whiskey and rye singin' this'll be the day that I die. Drink tiny ad.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 8711 times.
Similar Threads
Problem Using Sockets and BufferedReader
How to configure Tomcat to resolve host names
Getting the Client machine name
How to get computer name?
How to get own ip Address:
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 08:33:07.