A customer’s domain has been migrated. The new nameservers are in place at the registrar. The cPanel zone has the new NS records too. Most queries return correctly, but one specific resolver keeps returning the old nameservers. The cause is the difference between the NS records published at the registrar (which appears in the TLD’s referral) and the NS records in the zone itself (which BIND returns when queried directly). Both exist; they should match; they often don’t.
What’s happening
There are two distinct “NS record” concepts:
- NS at the parent: the TLD’s zone has
example.com. NS ns1.host.com.. This is the referral — it tells resolvers where to ask forexample.com. The registrar controls these via the registrar UI. - NS in the zone: the
example.comzone itself has@ IN NS ns1.host.com.records. These are returned when a resolver queriesexample.com NSand the authoritative server answers.
When the two disagree, behaviour depends on the resolver. Some take the parent’s NS as authoritative (since the parent’s delegation is what they followed). Others trust the zone’s own NS records because they came from the authoritative server. Most resolvers eventually align on the zone’s NS, but until the cached parent NS expires (TTL at TLD), some resolvers still try the old nameservers.
cPanel auto-populates the zone’s NS records from /etc/nameserverips.conf and the server’s primary hostname configuration. If the operator changes the cluster topology (adds a new slave, removes an old one) without re-syncing the NS records in every zone, the in-zone NS list drifts from the registrar’s.
How to verify
Compare parent and child NS:
dig +noall +answer NS example.com @a.gtld-servers.net
dig +noall +answer NS example.com @ns1.host.com
dig +short NS example.com
The first is the parent’s view (registrar’s delegation). The second is the zone’s own NS records (authoritative server). The third is whatever your resolver currently has cached.
If the parent says ns1.old-host.com, ns2.old-host.com and the zone says ns1.new-host.com, ns2.new-host.com, there’s drift. The registrar update was incomplete or the in-zone NS wasn’t updated.
Check the in-zone NS records on the cPanel host:
grep -E '^\@.*NS|^example\.com\..*NS' /var/named/example.com.db
What to do
- Decide on the canonical NS list. Typically this comes from
/etc/nameserverips.confon the master cPanel host, which lists every nameserver IP/hostname pair. - Update the in-zone NS records to match the canonical list. Per zone:
# Remove existing NS records
for line in $(whmapi1 dumpzone domain=example.com --output=jsonpretty | jq -r '.data.zone[].record[] | select(.type=="NS") | .Line'); do
whmapi1 removezonerecord domain=example.com Line=$line
done
# Add the new NS records
whmapi1 addzonerecord domain=example.com name=example.com. type=NS nsdname=ns1.host.com. ttl=86400
whmapi1 addzonerecord domain=example.com name=example.com. type=NS nsdname=ns2.host.com. ttl=86400
Or use cPanel’s WHM > DNS Functions > Reset a DNS Zone which re-templates the NS records from the server config.
- Update the registrar to match. Most registrars expose this as the “nameservers” field. Edit until both lists are identical.
- Verify alignment with the three
digcommands above. - For bulk fix-up across many zones, automate. Loop over
whmapi1 list_zones, dump each, identify NS records that don’t match the canonical list, and run the add/remove pair.
A specific case worth calling out: cPanel’s “Reset DNS Zone” button overwrites every NS record with the current server config. If you’ve manually added an NS record at a subdomain (delegating staging.example.com to another nameserver), the reset destroys that custom NS. Use the reset only when you intend to wipe customizations.
When changing nameserver hostnames (e.g., renaming ns1.host.com to ns1.newhost.com), update both registrar and in-zone records in the same change window, and lower the NS TTL to 3600 a day before. Otherwise users cached on the old NS hostnames query a host that no longer answers.
Stack Harbor maintains NS alignment across registrar and zone as part of managed cPanel operations.