Mailing List Archive

Support open source code!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Hostname questions



Thomas O'Dowd wrote:

> The problem is where applications need to know how names map to ip addresses
> and vice-versa. They make standard library calls to functions like
> gethostbyaddr() to resolve names/addresses as they go a long, this library
[...]

It might be a good thing to add that you should use your
Fully Qualified Domain Name followed by your short name in /etc/hosts
because if /etc/host.conf and/or /etc/nsswitch.conf is set to
look at hosts first and dns later the entry in /etc/hosts
will be used by `hostname -f` to get the fully qualified domain name
which won't work if it isn't there.

So if the entry in /etc/hosts is

m.y.i.p		myhostname.domain.name	myhostname

hostname will return myhostname
hostname -f will return myhostname.domain.name

If the entry is just

m.y.i.p		myhostname

hostname and hostname -f will both return myhostname

-- 
Tobias							     PGP-Key: 0x9AC7E0BC
echo ${SIGNATURE}


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links