Tugger the SLUGger!SLUG Mailing List Archives

Re: [SLUG] Caching Name Server and Internal Hosts


On Fri, Sep 07, 2001 at 02:00:56PM +1000, Jill Rowling wrote:
> Is it conventional to put the FQDN first (in /etc/hosts) followed by the
> unqualified one, ie:
> 172.30.65.6  moose.awa.com.au moose
> or doesn't it matter?

The difference is what comes up when you do a reverse lookup.  Whatever
you put first will be used as the host whenever an IP->Name lookup is done.

> I have read somewhere that sendmail prefers it that way.
> 
> What happens if you put the FQDN elsewhere, eg
> 172.30.65.6  moose mailhost loghost moose.awa.com.au

Sendmail is smart enough to look for the first FQDN in the entry. So in your
entry it will look at moose, mailhost and loghost and decide none of them
are FQDN (based simply on the fact they dont have dots in them I believe),
and thus use moose.awa.com.au as the correct hostname.  What I wouldn't do
with sendmail is something like :

172.30.65.6 moose mailhost moose.internal moose.awa.com.au

As there's probably a good chance is will grab the wrong one - put
moose.internal last.


  Scott.