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

Re: fixing Sys::Hostname

Thread Previous | Thread Next
Nick Ing-Simmons
February 8, 2000 05:45
Re: fixing Sys::Hostname
Message ID:
Ilya Zakharevich <> writes:
>But given that most slip drivers I have seen for OS/2 do not do this,
>the question is moot.  One could run netstat to get the address of
>sl0, and then get the name back, but then one *needs* to know that it
>*is* slip.
>Another datapoint: a lot of homes run a homewide NIC network which is
>connected to the outside via a dialin node through one of the
>computers on the network.  

I do exactly that 
(Peak net is Dual-boot Linux/NT laptop, SPARCStation, Old NT Laptop, NT Desktop).

They all return a 'hostname' which is of no 
use to the outside world. But names are used when one machine in the house
wants to talk to another machine in the house.

gethostname() is the name of the machine on the local net.
If there is a real net (e.g. ethernet) then this is interesting.
If there is only a point-to-point SLIP link then gethostname() might 
as well return 'me' as there is noone else to care.

But that does not matter as nothing can connect to them by name anyway.
(What is going to connect my name to someting the other end of a 
dialup dynamic addressed SLIP link?)

If they connect elsewhere the outside world will see their IP address
as being that of the gateway which then does address translate.

>Mind boggles what hostname could return...

The UNIX boxes return hostname as 
described by Tom and myself, the NT boxes return MACHINE_NAME or some 
such from the registry which was filled in for me when I filled 
in the Networking panel - I assume Win9X would be similar to NT.

The names are used as WINS names on the 
local 192.168.0.* IP network. For good measure the router runs 
a local DNS for * domain 
"You out there" do see the name in e-mail as in but 
that is okay because there is an MX record for which 
happens to be my ISP.

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