Symptoms
By default, cPanel will create zone files for the system hostname and root nameserver names, during initial setup. Occastionally this can cause confusion when changing IPs for those names, within the zone file for the parent domain, in which you may find the hostname and nameserver names still resolving to the old IP address.
Description
This typically happens on a system where the hostname and nameservers are configured in WHM during initial setup, before a domain account for the parent domain is created.
Take this test VM I have here, where the system hostname was set to "centos7.domain.tld", and nameservers for root set as ns1. and ns2.domain.tld, during initial setup. Then a domain account was created later for the domain "domain.tld".
~]# ls -alh /var/named/*.db | grep 11-90-0-6.tld
-rw------- 1 named named 809 Oct 6 08:02 /var/named/domain.tld.db
-rw------- 1 named named 1.2K Oct 6 00:59 /var/named/centos7.domain.tld.db
-rw------- 1 named named 690 Oct 6 07:28 /var/named/ns1.domain.tld.db
-rw------- 1 named named 690 Oct 6 07:28 /var/named/ns2.domain.tld.db
If for some reason your system has changed IPs since the hostname and nameserver zone files were created, if not specifically updated, then they may serve something different than the parent domain.
All of this, of course, assumes that the authoritative nameservers for the parent domain, are managed by cPanel on your server.
Troubleshooting
Any time you see dns resolve a domain/hostname to an IP that differs from your zone file, the first step is to check the SOA record with a dig:
~]# dig @ns1.domain.tld hostname.domain.tld SOA +short
The Serial for the zone file being served will be in the 3rd column of the result, in this example, "2020100601". Compare to similar query for the parent domain, and check if that Serial is different.
To find the zone file being served, use grep to find the zone files that match the serial:
~]# grep 2020100601 /var/named/*.db
/var/named/centos7.domain.tld.db: 2020100601 ;Serial Number
/var/named/ns1.domain.tld.db: 2020100601 ; serial, todays date+todays
/var/named/ns2.domain.tld.db: 2020100601 ; serial, todays date+todays
Resolution
To quickly resolve the issue with the wrong IP being served for the hostname and/or nameserver names:
- Make sure proper A records exist for the hostname and nameserver names, within the zone file for the parent domain
- Remove separate zone files for the system hostname and nameserver names, using the Delete a DNS Zone page in WHM.
- Query your nameservers with dig, to confirm that both the correct serial and A records are served from the parent domain's zone file.