On Friday 22 December 2006 12:20, David Relson wrote:
> On Thu, 21 Dec 2006 21:45:07 -0800
> Kevin O'Gorman wrote:
>
> ...[snip]...
>
> > Oops.  I should have known I could answer my own question with a
> > little more digging.  I now see that there's
> >     hostname
> >     hostname --fqdn
> >     dnsdomainname
> > and they all work by looking in /etc/host.conf, and if (as is true
> > here) that says
> > to use the hosts file first, it looks for it in /etc/hosts, which has
> > the fqdn. I seem to dimly recall that it actually looks for the first
> > non-comment, but that
> > cannot be quite right, because localhost comes first in my copy.
> > Maybe it's the first
> > routable IP number?
> >
> > I think this sub-problem is solved.  I've commented my config files a
> > bit more, so I
> > won't make the same mistake again.
> >
> > ++ kevin
>
> Now, I'm curious!  On my system, I see the following:
>
>   dnsdomainname     osagesoftware.com
>   hostname          osage.osagesoftware.com
>   hostname --fqdn   osage.osagesoftware.com
>
> /etc/hosts contains:
>
>   192.168.1.10 osage.osagesoftware.com osage
>
> "strace -feopen" shows that /etc/hosts is opened by "hostname --fqdn"
> but not "hostname".
>
> What have I got wrong?
>
> Regards,
>
> David
>
> P.S.  Greetings from one Kiewit alumni to another ...

I discovered that the order of entries on the localhost line is important to 
avoid hostname being identified as "none".  I suppose in your system it 
should be:

127.0.0.1     osage.osagesoftware.com osage localhost

HTH
-- 
Regards,
Mick

Attachment: pgpeBFcfe0glo.pgp
Description: PGP signature

Reply via email to