Hostname A record warning e-mail

tokyosama

Member
May 14, 2013
10
0
1
cPanel Access Level
Root Administrator
Hi,
I'm new to Cpanel and i need some help with this issue. I have 4 ip on my cloud server 1xMain Server, 1xshared and 2xNameserver the dns i setup is correct and able to target my domain but i keep getting an email saying dns error

IMPORTANT: Do not ignore this email.

Your hostname (server.domain.com) could not be resolved to an
IP address. This means that /etc/hosts is not set up correctly,
and/or there is no dns entry for server.domain.com. Please be
sure that the contents of /etc/hosts are configured correctly, and
also that there is a correct 'A' entry for the domain in the zone
file.

Some or all of these problems can be caused by /etc/resolv.conf
being setup incorrectly. Please check that 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' option under 'Dns Functions' in
your Web Host Manager.
 

quietFinn

Well-Known Member
Feb 4, 2006
2,109
580
493
Finland
cPanel Access Level
Root Administrator
If your server's hostname is server.domain.com then make sure there is an A record for server in the DNS zone of the domain domain.com.
 

Veeble-Adam

Active Member
May 7, 2013
43
0
6
cPanel Access Level
Root Administrator
That is not a big problem. Most probably, you received this alert because, there was a mismatch in IP address configured for hostname in DNS and in file /etc/hosts.

Check the results of the following two commands:

# ping -c 1 hostname
# dig +short hostname @localhost

If the dig command didn't give any result, you may need to use the "Add an A entry for hostname" option in the WHM.

Add an A Entry for Your Hostname
 

tokyosama

Member
May 14, 2013
10
0
1
cPanel Access Level
Root Administrator
That is not a big problem. Most probably, you received this alert because, there was a mismatch in IP address configured for hostname in DNS and in file /etc/hosts.

Check the results of the following two commands:

# ping -c 1 hostname
# dig +short hostname @localhost

If the dig command didn't give any result, you may need to use the "Add an A entry for hostname" option in the WHM.

Add an A Entry for Your Hostname
I keep Adding an A entry for hostname on 2 ip but i still get an dns email error from my server
 
Last edited:

Veeble-Adam

Active Member
May 7, 2013
43
0
6
cPanel Access Level
Root Administrator
I keep Adding an A entry for hostname on 2 ip but i still get an dns email error from my server
Not sure why you add A entry for 2 IP addresses.

Check the primary IP address of the server and add A entry for that IP only.

Check and confirm that the zone file contains the correct DNS records. [/var/named/hostname.db].
 

quietFinn

Well-Known Member
Feb 4, 2006
2,109
580
493
Finland
cPanel Access Level
Root Administrator
I keep Adding an A entry for hostname on 2 ip but i still get an dns email error from my server
Maybe it would be easier if you just go and check if there is an A record or not?
 

tokyosama

Member
May 14, 2013
10
0
1
cPanel Access Level
Root Administrator
cpanel.png
I did check and add A record...I'm not sure which ip to used to add A record either my main server ip that have cpanel or my other ip the one i setup dns
 

quietFinn

Well-Known Member
Feb 4, 2006
2,109
580
493
Finland
cPanel Access Level
Root Administrator
The error message says clearly:

Your hostname (server.domain.com) could not be resolved to an
IP address. ...
If there is an A record for server in the DNS zone of the domain domain.com then I would guess that that DNS zone is not used.
In the registrar of the domain domain.com, are the name servers pointing to your server?
 

GIANT_CRAB

Well-Known Member
Mar 23, 2012
89
0
56
cPanel Access Level
Root Administrator
Firstly, force resolvers (/etc/resolv.conf) to use Google DNS.
Secondly, make sure that your hosts file (/etc/hosts) has content matching your DNS records.

my friend register domain is not pointing on my server but pointing on cloudflare that link to my server
Are your name servers setup correctly to what Cloudflare wants it to be?
 

tokyosama

Member
May 14, 2013
10
0
1
cPanel Access Level
Root Administrator
Firstly, force resolvers (/etc/resolv.conf) to use Google DNS.
Secondly, make sure that your hosts file (/etc/hosts) has content matching your DNS records.



Are your name servers setup correctly to what Cloudflare wants it to be?
how do i check (/etc/resolv.conf) and (/etc/hosts)?

Yes, the nameserver r setup right and my site is up under cloudflare but i still get this email again that dns still not resolve its very confusing why i keep getting this email
IMPORTANT: Do not ignore this email.

Your hostname (server.domain.com) could not be resolved to an
IP address. This means that /etc/hosts is not set up correctly,
and/or there is no dns entry for server.domain.com. Please be
sure that the contents of /etc/hosts are configured correctly, and
also that there is a correct 'A' entry for the domain in the zone
file.

Some or all of these problems can be caused by /etc/resolv.conf
being setup incorrectly. Please check that 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' option under 'Dns Functions' in
your Web Host Manager.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,270
463
Hello :)

You will need to ensure the "A" record for your hostname is added on the server that handles the DNS for the domain name associated with your hostname. So, let's say your hostname is:

hostname.server123.com

You will need to access the DNS host of "server123.com" and ensure the "A" record for "hostname" is added. You may find that a website such as "intodns.com" is useful for determining the name servers used by the domain name.

When you have configured the "A" record, you can check to see if the issue is resolved by running the following command:

Code:
# /scripts/ipcheck --verbose
Thank you.
 

tokyosama

Member
May 14, 2013
10
0
1
cPanel Access Level
Root Administrator
Hello :)

You will need to ensure the "A" record for your hostname is added on the server that handles the DNS for the domain name associated with your hostname. So, let's say your hostname is:

hostname.server123.com

You will need to access the DNS host of "server123.com" and ensure the "A" record for "hostname" is added. You may find that a website such as "intodns.com" is useful for determining the name servers used by the domain name.

When you have configured the "A" record, you can check to see if the issue is resolved by running the following command:

Code:
# /scripts/ipcheck --verbose
Thank you.
Hi cPanelMichael,
I try either my main server ip and site ip but the result is still the same when i add "A" record for hostname
udate.png
udate2.png
Could it be cause by Cloudflare that my friend added that i keep getting this email dns error
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,270
463
The warning message is accurate because your hostname does not resolve to an IP address. You will need to ensure the "A" record is configured for the hostname at the DNS provider of it's domain name. It looks like you are using CloudFlare for DNS purposes based on the name servers used, so you will need to ensure the "A" record is configured at that DNS provider.

Thank you.
 

tokyosama

Member
May 14, 2013
10
0
1
cPanel Access Level
Root Administrator
Hi, i been adding major change on either 2 ip for A record for hostname if it would resolve the issue but then all of a sudden when i login to my whm login it give me an Internal Server Error 500
 

quietFinn

Well-Known Member
Feb 4, 2006
2,109
580
493
Finland
cPanel Access Level
Root Administrator
Hi, i been adding major change on either 2 ip for A record for hostname if it would resolve the issue but then all of a sudden when i login to my whm login it give me an Internal Server Error 500
That 500 error has nothing to do with the A record problem.
 

tokyosama

Member
May 14, 2013
10
0
1
cPanel Access Level
Root Administrator
I keep change either my main server or site ip on A record in order to resolve the issue but it make it worst now i keep receiving email nameserver failed or recovered
email.png
 
Last edited:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,270
463
I keep change either my main server or site ip on A record in order to resolve the issue but it make it worst now i keep receiving email nameserver failed or recovered
Feel free to open a support ticket and we can take a closer look:

Submit A Ticket

Thank you.