3

This question already has an answer here:

There's a (quiet) argument between me and my boss in regard to the right way to configure HOSTNAME directive in /etc/sysconfig/network file:

As far as I know, in the HOSTNAME directive you should specify the machine host name and not fully qualified domain name as my Boss says.

Why do I think that this is how it's supposed to be?

Because when you run:

hostname

The output should be your machine's host name and when you run:

hostname -f

The output should be hostname.dns.suffix

So in most servers in the production environment the /etc/sysconfig/network file is configured with HOSTNAME=FQDN and when you run hostname you get FQDN and I would like to change it to hostname rather than FQDN.

So now my boss wants a proof in regard to it but when I Google about it, I see in some sites that it's ok to set it as FQDN and in some it says that it must be only hostname.

In CentOS official documentation site they say it should be configured with FQDN but in tldp.org they say it should be configured with just hostname.

So my question is, what is the right way to configure HOSTNAME in /etc/sysconfig/network?

marked as duplicate by ewwhite, HBruijn, Sven Aug 31 '15 at 12:14

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.