Reply to "set FQDN for hostname"

Tom H tomh0665 at gmail.com
Thu Nov 4 14:32:52 UTC 2010


I deleted the original email so I'm starting a new thread, with apologies.

> Is there a GUI for setting the FQDN?
>
> manpage for hostname:
>
> Technically: The FQDN is the name getaddrinfo(3) returns for the host
> name returned by gethostname(2). The DNS  domain  name  is  the  part
> after the first dot.
>
> Therefore  it depends on the configuration (usually in /etc/host.conf)
> how you can change it. Usually (if the hosts file is parsed before DNS
> or NIS) you can change it in /etc/hosts.
>
> I ask because the manpage says that *usually* it's set from /etc/
> host.conf, but doesn't really say how change it if not there.

The answer is in the man page snippet that you quoted "(if the hosts
file is parsed before DNS or NIS)".

If you set the "hosts" resolution to check a name service (dns, nis,
nisplus, ldap) and there's a value for your box in that db, setting
the fqdn in "/etc/hosts" or "/etc/hostname" won't matter.

By the way, the "order" line in "/etc/host.conf" determines the
resolution order for "old versions of the C library". Look at
"/etc/nsswitch.conf" for the "hosts" (and all other) resolution order.




More information about the ubuntu-users mailing list