Ubuntu – Should one use FQDN in /etc/hostname instead of hostname

dnsetchostname

As I read in man page, it is recommended to put hostname(without domain name) to /etc/hostname.
For example, host instead of host.domainsub.domaintld.
But, as I know, some software relies on having FQDN in /etc/hostname.

What should one specify in /etc/hostname on Debian/Ubuntu machines?

If not FQDN, where FQDN should be specified instead?

I know, question is a bit old, but didn't found clear answer. Some people say hostname, some – FQDN. Thanks.

Best Answer

In the /etc/hostname file you use only the hostname. The FQDN you can set on: /etc/hosts that might look like:

127.0.1.1        thishost.mydomain.org    thishost

According to manual of the hosts file.

http://man7.org/linux/man-pages/man5/hosts.5.html

Related Question