DNS Setup Emails... Can't Figure Out Why!

baldidiot

Member
Jul 6, 2011
6
0
51
So once a day I get the:

"IMPORTANT: Do not ignore this email.

Your hostname (***) could not be resolved to an IP address."

Type email. I've tried everything I can think of, but nothing seems to satisfy it. If you check the IP of the hostname it does in fact resolve to the IP of the VPS. The /etc/hosts file is also set up correctly.

I tried searching but all of the solutions I found related to things I've already done. Any ideas?
 

ServerMascot

Member
Jan 17, 2011
13
1
53
Hello ,

Check the hostname of your server and check the A record of your server hostname from out side of the server. A record of the hostname should point to server default/main IP. In case if your server hostname is not pointing to any IP then please add a A record for the server hostname at your nameservers end. Also set the RDNS for the server IP to what is your hostname of the server to avoid any further issue related with emails etc..

Once the server hostname has A record run the cpanel script /scripts/ipcheck it will send the email to the associated email address if there is any issue with the hostname of the server.
 

baldidiot

Member
Jul 6, 2011
6
0
51
Oops, I thought I had notification emails to replies. I guess not...

Thanks for the responses guys. I'm using my hosting companies nameservers, not custom nameservers - this wouldn't make a difference, right?

The resolv/conf file has the correct nameserver IP's, but should it be saying 'domain'? What is the correct setting for this?

####### Automatically generated by OnApp (2.0.rc6)
domain
nameserver 83.170.64.2
nameserver 83.170.69.2


Here's the /etc/hosts

####### Automatically generated by OnApp (2.0.rc6)
127.0.0.1 localhost
109.123.112.157 uk2.synaptic-media.com uk2
 
Last edited:

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
43
348
somewhere over the rainbow
cPanel Access Level
Root Administrator
Change /etc/resolv.conf to use good working public resolvers:

nameserver 8.8.8.8
nameserver 8.8.4.4

Those are Google's public resolvers. These would go above the ones you already have listed in the file.

Of note, to see if the issue is actually the resolvers, simply try to dig the hostname on the machine itself:

Code:
dig +short uk2.synaptic-media.com
If it isn't digging locally on the server, then it is almost always the resolvers in /etc/resolv.conf being cached or not working properly to resolve the hostname. Public resolvers are typically a better option over using those of the hosting provider.
 

baldidiot

Member
Jul 6, 2011
6
0
51
Thanks! Ok I've tried changing the resolvers to the ones you suggested. And when I tried to dig the hostname it returned:

dig: parse of /etc/resolv.conf failed

Is it to do with the "domain" part? Should this contain a reference to something rather than just saying "domain"?

####### Automatically generated by OnApp (2.0.rc6)
domain
nameserver 8.8.8.8
nameserver 8.8.4.4
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
43
348
somewhere over the rainbow
cPanel Access Level
Root Administrator
Yes, domain should contain the root domain if you have that line in /etc/resolv.conf file. I would simply suggest removing that line anyway, since it isn't required and only have the nameserver entries.