[CMI.PM] Authoritative hostname?

Mitch Kutzko mitch at ncsa.uiuc.edu
Wed Nov 12 14:45:21 CST 2003


Hi again!

Different question today:  What's the best way you recommend to reliably
get an authoritative Fully Qualified Domain Name for a given machine?

I've been using gethostbyaddr() and doing a reverse lookup on the IP
address, but sometimes that comes back with "woof" instead of
"woof.uiuc.edu" if the /etc/hosts file isn't set up correctly.

On the machine itself, I can use the Net::Domain::getfqdn() call, but that
sometimes gives spurious results depending on the contents of
/etc/resolv.conf.  And in any event, if other folks are doing a
gethostbyaddr(), the name they each come back with for the same machine may
not agree with each other.

So.  Any thoughts?

Mitch
--
Mitch Kutzko | mitch at dast.nlanr.net | mitch at ncsa.uiuc.edu | 217-333-1199
http://hobbes.ncsa.uiuc.edu/



More information about the Champaign-Urbana mailing list