How to fix server name in DNS Zones following a server name change

AndyB78

Well-Known Member
Oct 7, 2003
80
2
158
Romania
cPanel Access Level
Root Administrator
Hello,

We had to change the hostname on one of our servers (in fact we migrated all accounts and only afterwards we have migrated the server name as well) but the server name inside DNS zones remained unchanged.

I am referring to records like:
_caldav._tcp.domainname 300 IN SRV 0 0 2079 servername.

I intend to do it like this:
cd /var/named; sed -i 's/wrong_server_name/correct_server_name/g' *.db

And restart named (bind).

But I can see there are 4 .db files for each domain (caches and all).

I assume that I should only change the .db files located directly in /var/named. Is this correct? Should I do anything else (besides backups I mean)?

Thanks!
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,295
1,275
313
Houston
Hi @AndyB78


You shouldn't need to modify the cache files but when you manually modify a DNS zone file you need to also update the serial. For example:

This is my original serial:

Code:
                                                2019012101 ;Serial Number
year 2019
month 01
day 21
change # 01

So if I was to modify it today for the first time It'd need to be changed to the following:

Code:
                                                2019032201 ;Serial Number