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

Re: fixing Sys::Hostname

Thread Previous | Thread Next
Nick Ing-Simmons
February 8, 2000 08:23
Re: fixing Sys::Hostname
Message ID:
Tom Christiansen <> writes:
>>>    % grep localhost /etc/hosts
>>>	localhost	
>>Which is exactly my point ;-)  there is no alias there, just the one name
>>and that makes 'localhost' the official name of the address.
>But I've never heard of "localhost" ever being anything but
>"127.1" as an address.  It's extremely expected.

And it still is with the alias scheme - I am not suggesting changing 
that or the existance of name 'localhost'.

I just point out if its "official" name (from /etc/hosts) was 
what gethostname() would return then there would not need to 
be a gethostname() API ;-) - you would just use gethostbyname()
to get official name of well know 'localhost' alias. 

>>and yours "should" be : 
>> chthon localhost	
>I think not.

I know this is a non-starter in UNIX world - but it could have been done
that way...

Nick Ing-Simmons <>
Via, but not speaking for: Texas Instruments Ltd.

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About