Global zone update command not working?
I wanted to make some small changes to zone files.
On the forums I found several thread that if you change values, you also have to update the serial number of all zone files.
And I found this command to do that in a couple of threads:
Ofcourse I made a backup first and this is what happening. Original (backup) file serial:
So I issue the command given and the serial is still exactly the same instead of changing to 2018042001. Reloading the namserver does not make any difference. When I edit the zone file via Edit DNS Zone in WHM, then the serial does change to 2018042001. So then it gets updated. Am I doing something wrong or why isn't this changing the 0 to a 1? Als something else confuses me from the Zone editor. Because of the moment of change, the server date/time is: April 21 2018, but the serial will be 2018042001. Serial numbers format are in normally YYYYmmddss. So I wonder why when the zonefile is editted, it's not updated to 20180421xx but the old date of 20180420xx is kept and used and only the last number is updated without the date?
find /var/named/*.db -mtime -1 -exec perl -pi -e 'if (/^\s+(\d{10})\s+;\s+serial/i) { my $i = $1+1; s/$1/$i/;}' '{}' \;Ofcourse I made a backup first and this is what happening. Original (backup) file serial:
2018042000 ;Serial Number
3600 ;refreshSo I issue the command given and the serial is still exactly the same instead of changing to 2018042001. Reloading the namserver does not make any difference. When I edit the zone file via Edit DNS Zone in WHM, then the serial does change to 2018042001. So then it gets updated. Am I doing something wrong or why isn't this changing the 0 to a 1? Als something else confuses me from the Zone editor. Because of the moment of change, the server date/time is: April 21 2018, but the serial will be 2018042001. Serial numbers format are in normally YYYYmmddss. So I wonder why when the zonefile is editted, it's not updated to 20180421xx but the old date of 20180420xx is kept and used and only the last number is updated without the date?
-
Hi, # cd /var/named # sed -i 's//2018042001/g' *.db You can execute above command to change the serial number.. 0 -
Thank you, I can use that for the domains not changed manually yet. Still wondering why on manual change the date is not change to todays date like 20180422xx. I discovered for some reason the WHM date is not corresponding the server date. Changes made today with the zone editor will change the serial to 20180421.xx today on the 22th which is server date/time. 0 -
Hello @rhm.geerts, Changes to the DNS zone using a cPanel & WHM feature such as "WHM >> Edit DNS Zone" don't replace the serial with the current date. Instead, the serial is simply incremented by one digit. For example, let's say a zone was created on 04-16-2018: # grep -i 'serial' /var/named/domain.tld.db 2018041600 ;Serial Number
Using "WHM >> Edit DNS Zone" to make a change to this zone in the future will increment the serial by one. EX:# grep -i 'serial' /var/named/domain.tld.db 2018041601 ;Serial Number
Thank you.0 -
Hello Michael. That's indeed what I discovered. For some reason it changed to 20180421 yesterday on that domain I tested. Normally it doesn't, you're correct. But my question was if there is a reason for it. I know it's not really necessary to use the correct date, but as far as I know it's common practice. DA for example uses correct dates too. And when used it's easy to see when the last DNS change was made. Which can't be seen by the way it's used now. So that's why I wonder why cPanel is not using it that way. 0 -
It's indeed no requirement, I thought that would be the reason. Thank you for confirmation. This can be marked as solved! 0
Please sign in to leave a comment.
Comments
6 comments