local address and hostname on Unix

Cees De Groot cdegroot at gmail.com
Tue Oct 4 12:44:27 UTC 2005


A Unix machine doesn't have a host address. Network interfaces have
host addresses. So the local host address should be returned as
127.0.0.1 on Unix.

(and irritating as it may be, I think Unix is right and Windows is
wrong in this respect).

On 10/4/05, Philippe Marschall <philippe.marschall at gmail.com> wrote:
> Hi
>
> I thought to get the network address and name of the local machine I do:
>
> NetNameResolver localHostName
> NetNameResolver localAddressString
>
> This works on Windows but on Unix it returns just the loopback
> addresses 'localhost' and '127.0.01'. So what is the way to do it on
> Unix?
>
> Cheers
> Philippe
>
>



More information about the Squeak-dev mailing list