The hostname on your machine will need to be set correctly. For rDNS requests your hostname must be an FQDN (fully qualified domain name) and have an A record. To change hostname or update your hostname login as the root user to your CentOS VPS Server. So you have two options. By using the automated hostnamectl set-hostname command or edit the files manually.
Change Hostname Automatically
As the root user or, a user with root privileges issue the following command. Update as required to change your hostname automatically.
hostnamectl set-hostname uk-command.f2h.cloud reboot
Manually Update Hostname
To manually make modifications to the hostname assigned to your Discovery Instance we must edit a number of files. You should only need to do this if the first option doesn’t work.
So to get started. Open up the network file and set the hostname of the server in the HOSTNAME- variable. A hostname must always contain at least two (.) One before your domain and one or two with your TLD. For example, server.domain.com.
NETWORKING=yes HOSTNAME=server.first2host.co.uk GATEWAY=213.186.XX.254
So, just modify the server.first2host.co.uk variable to the hostname you require then save that file.
Edit The /etc/hosts file
Inside the host’s file you will see a block of text like this;
127.0.0.1 localhost.localdomain localhost 213.186.XX.XX ns1.first2host.co.uk
Modify the last line to the required hostname and make sure the correct IP is listed. This should be your VPS Servers IP. Save that file. Reboot your machine and your hostname should now be changed. You can check this by just issuing the hostname -f command in an ssh console.
How was this article?
You might also like
More from Dedicated Servers
If you are using Cloudflare on your Apache server you will always see Cloudflare IPs in your logs and not …
Cloud-init is a popular way to automate deployments of instances in a cloud or none cloud environment. To save having …