Domains with external name servers are showing wrong local DNS results

kdean

Well-Known Member
Oct 19, 2012
408
82
78
Orlando, FL
cPanel Access Level
Root Administrator
Using 11.34.0.8

I have a few domains where the client's control their DNS, so for those domains under Edit DNS, they're set to their 3rd party name servers such as Go Daddy name servers. They also host their email offsite so their MX record is not local.

Yet, when mail tries to send to their domain through the cPanel server or if I do a dig in the shell for the MX record for these domains I get the local DNS pointing to the site server and not the actual mx records as reported by doing a dig on any other server / computer. The domains are listed under /etc/remotedomains, but I'm not sure they should be listed, but that only would work if the external DNS was being queried.

Mail error says:

"lowest numbered MX record points to local host"

Dig just shows results as seen on the Edit DNS page. It even shows the 3rd party name servers but clearly isn't getting it's info from them.

Why is it not querying the external name servers when they're listed in the local DNS record? Shouldn't it ignore any local records if the local DNS is not the authoritative name server?

I also tried restarting named with no effect.

I ended up for now just duplicating the mx records locally, but that just seems to be a bandaid since if they change their DNS, I shouldn't have to manually mirror the changes on the site server.

So, am I just missing something obvious or is there a bug?
 

vanessa

Well-Known Member
PartnerNOC
Sep 26, 2006
959
76
178
Virginia Beach, VA
cPanel Access Level
DataCenter Provider
There does seem to be something weird going on. I'm inclined to say that maybe your resolver in /etc/resolv.conf is perhaps returning an incorrect result.

This is perhaps a dumb question, but I have to ask - when you say that these domains are pointed to external DNS, do you mean that your clients simply used the DNS editor to change the NS records as mentioned, or did they actually delegate the DNS through their domain registrar? Simply setting the NS records on the local nameserver isn't correct - the nameserver should be set through the domain registrar.
 

kdean

Well-Known Member
Oct 19, 2012
408
82
78
Orlando, FL
cPanel Access Level
Root Administrator
My resolv.conf has a local reference and Google Public DNS:

nameserver 127.0.0.1
nameserver 8.8.8.8
nameserver 8.8.4.4

Should I not have the localhost reference at all? Seems that this is where the problem lies since it comes first.

The domains are all delegated properly. I was referring to the local DNS records listing the correct Name servers on the Edit DNS page.

I know I added the Google DNS, but maybe I was supposed to replace the localhost reference when I did rather than add to it. Just to be safe, could I get confirmation that nothing negative should happen if I remove the localhost reference.

Thanks for the help.
 

kdean

Well-Known Member
Oct 19, 2012
408
82
78
Orlando, FL
cPanel Access Level
Root Administrator
I saw in another thread that localhost shouldn't be referenced here, so I removed it and it appears to have fixed the issue, with no other ill effects so far.