develooper Front page | perl.perl5.porters | Postings from February 2000

Re: fixing Sys::Hostname

Russ Allbery
February 8, 2000 15:39
Re: fixing Sys::Hostname
Message ID:
Nick Ing-Simmons <> writes:

> If I do gethostbyname('localhost') on such a machine I get 'localhost'
> back. But I would "like" to get back "pluto" or ""

> Thus my entry "should" be :

> pluto localhost	

> and yours "should" be : 

> chthon localhost	

The difficulty with doing this comes when you turn around and want to do a
forward lookup.  Now, when you look up, what IP address do
you get?  Both?  At least Solaris uses this mapping to figure out how what
IP address to apply to different interfaces, so this potentially breaks a
lot of assumptions.

Russ Allbery (         <URL:> Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About