How to Configure the Hostname of the Server

Hostname X FQDN


Hostname is the name that you give to your machine.
It is used on your local network and is shown at terminal after the name of loged user,
ex: john@[hostname]. There is no way to access your server remotely with this name.

The name could be anything that start with a letter and can have numbers, undercore and dash.
Ex: “john-notebook” or “office-pc3” or “plato”.

$ echo "machine-name" > /etc/hostname
$ hostname -F /etc/hostname


Full Qualified Domain Name is the domain that you pay to register.
It is the only way that you can access your machine by a name and not by an IP.

ex:,, or, it is your choice.
Configure it is mandatory when you want to have a valid reverse dns.

Update /etc/hosts

Here you will configure your external IP followed by your FQDN and your hostname, in that order.
If yout dont follow that order, you can`t have your reverse dns working.

2 localhost.localdomain localhost
XXX.X.X.X machine-name.domain.tld machine-name