I recently purchased a VPS from OVH with Centos 7 preinstalled. I want to make sure my hostname is correctly set.
According to some tutorials:
hostname returns the hostname
hostname -f returns the FQDN
After executing these commands, I got the same result: vpsxxxxxxxx.ovh.net I thought hostname and FQDN are different!
cat /etc/hosts
127.0.0.1 - localhost
IP - vpsxxxxxxxx.ovh.net - vpsxxxxxxxx
I am confused, I have linked a domain name that I have purchased separately to my VPS, I am also planning to add another domain name to run two sites in my VPS.
Is my hostname correct?
How can we call vpsxxxxxxxx.ovh.net? An external domain name, an internal domain, a hostname, a subdomain of ovh.net?
What about the two domains names that I have linked to the VPS? Do they need some configurations in /etc/hosts?
I have to fix these issues to enable postfix mail server.
The hostname should always be set to the FQDN in CentOS 7, according to Red Hat's recommendations.
If you're running email on the server, then the hostname should be set to one in a domain that you control, rather than one controlled by your service provider. You do not need to place it in
/etc/hosts
, provided that the appropriate DNS entries exist for the name.