How To… Fix cPanel Hostname A Record Error
Product ReviewsPublished January 17, 2012 at 9:16 am No Comments
Please note: These instructions are for clients on the VPSLatch network only. Always exercise caution when modifying any configuration files.
For this example, we will assume that a client just signed up for a new VPS account (or formatted/reinstalled an existing one) with the following hostname and corresponding IP address:
Hostname: vps.clientserver.com
IP Address: 123.456.789.123
Since brand new VPS accounts are provisioned using preconfigured templates, a client may notice the following error message just after provisioning (or re-provisioning) a cPanel/WHM virtualized environment:
IMPORTANT: Do not ignore this email. The hostname (vps.clientserver.com) resolves to 0.0.0.0.
It should resolve to 123.456.789.123.
Please be sure to correct /etc/hosts as well as the 'A' entry in zone file for the domain.
Some are all of these problems can be caused by /etc/resolv.conf being setup incorrectly.
Please check this file if you believe everything else is correct.
You may be able to automatically correct this problem by using the ' Add an A entry for your hostname ' under ' Dns Functions ' in your Web Host Manager
There are 2 ways this issue can be addressed. We will cover both below:
1. The GUI route (via WHM)
Just as the error message instructed, you may simply login to WHM and select the “Add A Record for Hostname” tool. This option will resolve the issue the majority of the time and works for anyone, regardless of what network they reside on. If it does not stop the warning email from being sent, then you will have to take the following steps.
2. The SSH route
Step 1: SSH to your server and nano /var/named/HOSTNAME.db -or- DOMAIN.db (if the domain for the hostname exists on the server) and ensure that the A record exists and is pointing to the main IP address correctly.
Step 2: Fix the /etc/hosts file. This is an example of what the hosts file would theoretically look like before editing the file:
0.0.0.0 vps.clientserver.com vps vps.otherserver.com
#Auto-generated hostname. Please do not remove this comment.
123.456.789.123 vps
127.0.0.1 localhost
As seen in the example above, the 0.0.0.0 entry is incorrect and needs to be modified. Also the hostname for the correct IP entry is not listed properly and will need to be updated as well. Here is an example of what the correct version of the hosts file should look like in this specific situation:
#Auto-generated hostname. Please do not remove this comment.
123.456.789.123 vps.clientserver.com vps
127.0.0.1 localhost.localdomain localhost
This is the basic structure for all hosts files should look. Of course, the hostname/IP information will be specific to your own account.
Step 3: This step is specifically meant for VPSLatch clients only. Fix the /etc/resolv.conf file. This file tells the server what nameservers to use to resolve domains from the server. This is what the resolv file would thoeretically look like before correcting it:
search localhost
-or-
nameserver 4.2.2.1
nameserver 4.2.2.2
The search localhost entry can cause issues and their are better nameserver entries to use. Below is the correct resolv file:
nameserver 66.7.206.2
nameserver 66.7.207.2
Step 4: Run the following commands (in order):
rndc flush
rndc reload
/scripts/restartsrv_named
That should conclude the steps that one would need to take to resolve cPanel’s alarming email message. If followed correctly, the warning message will not be generated again.
Still need help? Let us know via Live Chat, Twitter or Facbook. Also, don’t forget about our Forums where you can find many answers to commonly asked questions.



