I'm trying to install CentOS 7 server. During the installation what to choose for the host name? Is "server.mydomain.tld" good or do I need to choose only "server"?
The official CentOS documentation says the hostname should be the FQDN.
HOSTNAME=<value>, where <value> should be the Fully Qualified Domain Name (FQDN), such as hostname.example.com, but can be whatever hostname is necessary.
During the CentOS 7 installation in the INSTALLATION SUMMARY screen of the CentOS 7 installer, click on the NETWORK & HOSTNAME label and type your system FQDN in the Hostname field. FQDN is combination of hostname+domain-name. For example, if your hostname is
server and your domain-name is
mydomain.com, then your FQDN is
To change the hostname in CentOS 7, follow the instructions in RHEL / Centos Linux 7: Change and Set Hostname Command.
You can choose whatever name you like.
Yes, usually it is suggested to use the Fully Qualified Domain Name (FQDN) for the
HOSTNAME (i.e. something like MyHomeServer.AlbaStar.com), but I personally do not see a lot of sense in this.
First of all, not all people buy domain names. And even if they buy, it does not mean that each their server is accessible through this domain name. For example, I am currently managing 4 CentOS servers. Only one of them I have "connected" to a domain name, others are accessible only though their IP addresses.
Second, for me the
hostname is like ID for the physical machine. Today I may use a particular CentOS server as a web-server for
my-business.com web-site, tomorrow I decide to move my web-site to another machine. If I use FQDN for the hostname I will have to change it, which is confusing.
That is why for my servers I use some names, which are easy to remember (e.g. names of famous people). Then I put the line
export PS1='\[\033[0;35m\]\u@\h:\[\033[36m\]\W\[\033[0m\] \$ '
~/.bashrc and my bash-prompt always shows me, which server I am working on, which is very convenient.
p.s. If you are not happy with the chosen name, you can always open
/etc/sysconfig/network and change the