Comment 8 for bug 1276796

Revision history for this message
Rodney Beede (business2008+launchpad) wrote : Re: bash fails to provide FQDN for PS1 with \H

The default install of Ubuntu fills in /etc/hostname with only the host name and not any of the DNS domain name parts.

For Ubuntu 13.10 the following is noted:
http://manpages.ubuntu.com/manpages/saucy/man1/hostname.1.html

/etc/hostname Historically this file was supposed to only contain the
       hostname and not the full canonical FQDN. Nowadays most software is
       able to cope with a full FQDN here. This file is read at boot time by
       the system initialization scripts to set the hostname.

For Ubutnu 12.04 the following is noted:
http://manpages.ubuntu.com/manpages/precise/man1/hostname.1.html

   /etc/hostname This file should only contain the hostname and not the
       full FQDN.

So the issue is how /etc/hostname is treated and that bash uses the value provided by how the distro set it up.

Ubuntu 13.10 still leaves out the FQDN in /etc/hostname when you install.

It'd be useful if the bash man page stated something like:

     \h
     The hostname, up to the first ‘.’.

     \H
     The hostname. Depending on the distro this may or may not contain the domain name or FQDN.