FQDN confusion

Brian McKee brian.mckee at gmail.com
Fri Apr 24 14:12:24 UTC 2009


On Fri, Apr 24, 2009 at 9:57 AM, Brian McKee <brian.mckee at gmail.com> wrote:
> What is supposed to be in /etc/hostname?  The hostname? or the FQDN?
> And what is usually placed in the /etc/hosts file after the 127.0.1.1
> entry - FQDN or hostname?
>
> What's started me on this was '\h' and '\H' in $PS1 were both just the hostname.
> Further poking -  hostname and hostname --fqdn both return the same,
> hostname -d returns null...
>
> If I put the FQDN in the /etc/hosts file then hostname -f and hostname
> -d work as expected,
> but $PS1="\H" still just shows hostname...

Answering some of my own questions - from
http://www.debian.org/doc/manuals/reference/ch-gateway.en.html

from 10.3.1
/etc/hostname. This file should contain only the system hostname, not
a fully qualified domain name.

from 10.4
If your system has a permanent IP address then use that; otherwise use
the address 127.0.1.1

That I didn't know - I've always had both in there.  if I redo it that
way, then hostname -f and hostname -d work as expected,
BUT, $PS1="\H" still doesn't work :-(  Wonder why? It does on my
Mandrake boxes as well as in OSX.  Thoughts?

Brian




More information about the ubuntu-users mailing list