MACscr

Well-Known Member
Sep 30, 2003
198
5
168
cPanel Access Level
Root Administrator
i seemed to screw up my cpaneldns cluster as I am seeing all zones on all cpanel servers and now even though i have removed a server from the cluster and performed a dns cleanup, its still showing other servers' dns zones. Any ideas on how i can get that cleaned up?
 

JawadArshad

Well-Known Member
PartnerNOC
Apr 8, 2008
459
7
68
PK
cPanel Access Level
DataCenter Provider
Are you seeing the all zones in "WHM >> DNS Functions" or in /var/named/ folder. If its the second case, you need to ensure that your servers (not serving DNS duties) have clustering set to "synchronize changes" in WHM while at your primary DNS, you need to set it as "Stand alone". This will ensure your primary DNS, does not copy back all the dns zones to all your servers.
For cleanup, I will wait for a cPanel tech to jump in and assist you.

i seemed to screw up my cpaneldns cluster as I am seeing all zones on all cpanel servers and now even though i have removed a server from the cluster and performed a dns cleanup, its still showing other servers' dns zones. Any ideas on how i can get that cleaned up?
 

MACscr

Well-Known Member
Sep 30, 2003
198
5
168
cPanel Access Level
Root Administrator
Yeah, i actually do know what i had done wrong, but its not part of the cluster anymore.

Actually i just checked one of the servers and it seems that only a few domains that dont below there are showing up in named.conf. Seems the issue is more with /var/named having an excess of domains that dont below to that system. i would think the contents of /var/named wouldnt really matter if there wasnt an entry in /etc/named.conf. Am I wrong?
 

JawadArshad

Well-Known Member
PartnerNOC
Apr 8, 2008
459
7
68
PK
cPanel Access Level
DataCenter Provider
Correct, only the space occupied by the zones will matter if there is no named.conf entry, and that space is minimal.

Yeah, i actually do know what i had done wrong, but its not part of the cluster anymore.

Actually i just checked one of the servers and it seems that only a few domains that dont below there are showing up in named.conf. Seems the issue is more with /var/named having an excess of domains that dont below to that system. i would think the contents of /var/named wouldnt really matter if there wasnt an entry in /etc/named.conf. Am I wrong?
 

MACscr

Well-Known Member
Sep 30, 2003
198
5
168
cPanel Access Level
Root Administrator
OH, im not worried about the storage space they are taking up. I am worried about the it adding 500% more entries in my "Edit DNS Zone" list. Which is what its doing right now.
 

chuza

Well-Known Member
Jul 4, 2008
47
0
56
How did you clean up the excessive zones from named.conf

OH, im not worried about the storage space they are taking up. I am worried about the it adding 500% more entries in my "Edit DNS Zone" list. Which is what its doing right now.
 

MACscr

Well-Known Member
Sep 30, 2003
198
5
168
cPanel Access Level
Root Administrator
I never manually cleaned up the named.conf. The only thing i have done besides removing it from the cluster, was run the DNS cleanup tool. Though I am not sure what else that really does besides remove duplicates. Thats one of the reasons why i think its so odd that im getting the iist of domains that im seeing that are listed in the "Edit DNS Zone" options and not the named.conf
 

chuza

Well-Known Member
Jul 4, 2008
47
0
56
I never manually cleaned up the named.conf. The only thing i have done besides removing it from the cluster, was run the DNS cleanup tool. Though I am not sure what else that really does besides remove duplicates. Thats one of the reasons why i think its so odd that im getting the iist of domains that im seeing that are listed in the "Edit DNS Zone" options and not the named.conf
Are you referring to /scripts/cleandns
 

cPanelDon

cPanel Quality Assurance Analyst
Staff member
Nov 5, 2008
2,544
14
268
Houston, Texas, U.S.A.
cPanel Access Level
DataCenter Provider
i seemed to screw up my cpaneldns cluster as I am seeing all zones on all cpanel servers and now even though i have removed a server from the cluster and performed a dns cleanup, its still showing other servers' dns zones. Any ideas on how i can get that cleaned up?
Is WHM the only area that is displaying DNS zones from other servers in your cluster, or are the DNS zones from other servers also seen elsewhere on each system?

Are any of the DNS zones from other servers stored locally, such as within the following directory path?
Code:
/var/named/
The "unmanaged_zones" auto-repair script might be of interest, depending on what is needed; this can help to locate DNS zones that might not be directly managed by the local server, such as if they originated from a different server in the cluster:
Code:
# /scripts/autorepair unmanaged_zones
Before attempting to remove any DNS zones I recommend saving a fresh backup:
Code:
# cp -av /var/named /var/named.backup.$(date -u +%Y%m%d%H%M%S%Z)
 

MACscr

Well-Known Member
Sep 30, 2003
198
5
168
cPanel Access Level
Root Administrator
Don, that seemed almost perfect, but unfortunately it seems to include a lot of zones that are on that server or at least managed on that server. I am moving all servers from the cluster and they are just for now going to do their own dns before i move to the new setup, so it really should only be zones from its own server. How does it create this list? Are they supposed to be domains not in the named.conf?
 

cPanelDon

cPanel Quality Assurance Analyst
Staff member
Nov 5, 2008
2,544
14
268
Houston, Texas, U.S.A.
cPanel Access Level
DataCenter Provider
Don, that seemed almost perfect, but unfortunately it seems to include a lot of zones that are on that server or at least managed on that server. I am moving all servers from the cluster and they are just for now going to do their own dns before i move to the new setup, so it really should only be zones from its own server. How does it create this list? Are they supposed to be domains not in the named.conf?
I believe one of the criteria may involve listing DNS zones that are not setup on a local cPanel account; the script may also look for DNS zones that are missing configuration entries, such as in /etc/named.conf. If you would like us to take a look at the situation you are welcome to submit a support request; with direct insight into seeing the DNS zone and clustering configuration we may be able to offer more specific suggestions or direction in how to proceed.
 

MACscr

Well-Known Member
Sep 30, 2003
198
5
168
cPanel Access Level
Root Administrator
Maybe i was looking at it wrong. One one system, it showed me that i could remove all those entries by running:

Code:
/scripts/unmanaged_zones
but that doesnt seem to do anything on two other systems. Well it doesnt delete any at least, it shows:

Code:
All zones accounted for and managed by cPanel/WHM. See /etc/unmanaged_zones for exclusions.
And shows the list of unamanged zones above it. Seems the two servers worked differently. One seemed to use that list for a delete list and the other used it for an exclusion list. Im confused.
 

cPanelDon

cPanel Quality Assurance Analyst
Staff member
Nov 5, 2008
2,544
14
268
Houston, Texas, U.S.A.
cPanel Access Level
DataCenter Provider
Maybe i was looking at it wrong. One one system, it showed me that i could remove all those entries by running:

Code:
/scripts/unmanaged_zones
but that doesnt seem to do anything on two other systems. Well it doesnt delete any at least, it shows:

Code:
All zones accounted for and managed by cPanel/WHM. See /etc/unmanaged_zones for exclusions.
And shows the list of unamanged zones above it. Seems the two servers worked differently. One seemed to use that list for a delete list and the other used it for an exclusion list. Im confused.
Domain names removed from the generated list (in "/etc/unmanaged_zones") will be removed upon manually running the matching script ("/scripts/unmanaged_zones"), thus excluding domains that are manually retained in the list; that is, domain names you decide to keep in the list are excluded from removal, while all domains that are deleted from the list will be removed.

When running the auto repair script for the first time, there should be text similar to the following:
Code:
Writing unmanaged/unauthoritative domains to /etc/unmanaged_zones
To remove any unmanaged domains from this system please edit /etc/unmanaged_zones
and remove any domains that you wish to have removed and run /scripts/unmanaged_zones.
Zones added through the WHM directly will be included in this list. Please review the zones
listed in the file carefully and ensure that they should be removed before deleting their
respective entries in /etc/unmanaged_zones.
Done
The auto-repair script will create the following file and matching script:
Code:
/etc/unmanaged_zones
/scripts/unmanaged_zones
The aforementioned two files may be removed to recreate a first-run scenario:
Code:
# rm -fv /etc/unmanaged_zones /scripts/unmanaged_zones
# /scripts/autorepair unmanaged_zones
 

chuza

Well-Known Member
Jul 4, 2008
47
0
56
Great post. Would this auto-repair script remove the unmanaged zones locally even if it is configured in a DNS cluster.
Normally if you use /scripts/killdns script which I believe cPanel must also be using, it removes the zones locally as well as from the clustered servers but obviously in the case mentioned in this thread, we only want unwanted zones removed locally. killdns or killdns-dnsadmin scripts do not have any switch to stop that from happening afaik.

Domain names removed from the generated list (in "/etc/unmanaged_zones") will be removed upon manually running the matching script ("/scripts/unmanaged_zones"), thus excluding domains that are manually retained in the list; that is, domain names you decide to keep in the list are excluded from removal, while all domains that are deleted from the list will be removed.

When running the auto repair script for the first time, there should be text similar to the following:
Code:
Writing unmanaged/unauthoritative domains to /etc/unmanaged_zones
To remove any unmanaged domains from this system please edit /etc/unmanaged_zones
and remove any domains that you wish to have removed and run /scripts/unmanaged_zones.
Zones added through the WHM directly will be included in this list. Please review the zones
listed in the file carefully and ensure that they should be removed before deleting their
respective entries in /etc/unmanaged_zones.
Done
The auto-repair script will create the following file and matching script:
Code:
/etc/unmanaged_zones
/scripts/unmanaged_zones
The aforementioned two files may be removed to recreate a first-run scenario:
Code:
# rm -fv /etc/unmanaged_zones /scripts/unmanaged_zones
# /scripts/autorepair unmanaged_zones
 

cPanelDon

cPanel Quality Assurance Analyst
Staff member
Nov 5, 2008
2,544
14
268
Houston, Texas, U.S.A.
cPanel Access Level
DataCenter Provider
Great post. Would this auto-repair script remove the unmanaged zones locally even if it is configured in a DNS cluster.
Normally if you use /scripts/killdns script which I believe cPanel must also be using, it removes the zones locally as well as from the clustered servers but obviously in the case mentioned in this thread, we only want unwanted zones removed locally. killdns or killdns-dnsadmin scripts do not have any switch to stop that from happening afaik.
I believe that /scripts/unmanaged_zones will only apply locally. As a precautionary measure I recommend to save a fresh backup of existing DNS zones.