Introduction
You might see an error status when querying for a domain against the server, such as "SERVFAIL" or "REFUSED". This guide covers the scenario where your nameserver is running and not returning results for a domain.
# dig A domain.tld @ns1.nameserver.tld
...
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 38914
;; flags: qr rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1
;; WARNING: recursion requested but not available
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;domain.tld. IN A
;; Query time: 47 msec
Procedure
First, you'll want to check the DNS zone for errors using the "named-checkzone" tool on the command-line:
# named-checkzone domain.tld /var/named/domain.tld.db
zone domain.tld/IN: has no NS records
zone domain.tld/IN: not loaded due to errors.
You would then want to address the errors via editing the DNS zone via cPanel or WHM whenever possible, on the server that is responsible for synchronizing the authoritative zone.
If you're running PowerDNS, you can also use "pdns_control bind-list-rejects" to list why a domain might not be loading in PowerDNS:
# pdns_control bind-list-rejects
domain.tld error ... parsing 'domain.tld' from file
'/var/named/domain.tld.db': Trying to insert non-zone data,
name='otherdomain.tld', qtype=TXT, zone='domain.tld'
As long as the zone exists and there's not any other reason (such as a firewall) for the zone to not load, a last resort troubleshooting method includes renaming and rebuilding the named.conf file:
# mv -vi /etc/named.conf{,.orig} && /scripts/rebuilddnsconfig