[Hostname-devel] Bug#718393: hostname --all-fqdns is broken: doesn't list the FQDN

Vincent Lefevre vincent at vinc17.net
Wed Jul 31 02:58:08 UTC 2013


Package: hostname
Version: 3.13
Severity: normal

On my machine, which is on a local network (thus doesn't have a
"public" IP address):

$ hostname --fqdn
xvii.vinc17.org

$ hostname --all-fqdns
xvii.local

It seems that xvii.local is set up by avahi-daemon, as I can see in
the syslog file:

Jul 28 18:12:34 xvii avahi-daemon[2690]: Server startup complete. Host name is xvii.local. Local service cookie is 1210368067.

However xvii.vinc17.org resolves to 127.0.1.1 (via /etc/hosts) while
xvii.local resolves to 192.168.1.2 (the IP address of eth0, obtained
via DHCP). This means that xvii.vinc17.org is permanent, while
xvii.local will no longer exist if eth0 is brought down.

The method use by "hostname --all-fqdns" should make sure that the
FQDN is listed, because this is what one expects.

The hostname(1) man page gives strange recommendations:

  -f, --fqdn, --long
    Display  the FQDN (Fully Qualified Domain Name). A FQDN consists
    of a short host name and the DNS domain  name.  Unless  you  are
    using  bind  or NIS for host lookups you can change the FQDN and
    the DNS  domain  name  (which  is  part  of  the  FQDN)  in  the
    /etc/hosts file. See the warnings in section THE FQDN above, and
    avoid using this option; use hostname --all-fqdns instead.

Why use --all-fqdns instead of --fqdn? If the goal is to rely on a
permanent FQDN (e.g. for host identification in log files are things
like that), then --fqdn is a much better way. Really, this depends
on what the user wants to do...

-- System Information:
Debian Release: jessie/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.10-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=POSIX, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages hostname depends on:
ii  libc6  2.17-7

hostname recommends no packages.

hostname suggests no packages.

-- no debconf information

-- debsums errors found:
sh: 1: /usr/sbin/dpkg-divert: not found



More information about the Hostname-devel mailing list