Update/edit all clients DNS Zone records on server hosting

If you ever have a case to override a lot of dns zone on the server? I never! and a little inconvenience if you have to change one by one zonefile.db domain. However, there was an easy method with the command is to “replace” an existing name in the zone file, following our example to change the IP, name servers and zone files TTL of your domain:

If you would like to change the A record in all the DNS zone files, execute the following:

replace “OLDIP” “NEWIP” — /var/named/*.db

to change the name servers in the zone files, execute

replace “oldns” “newns” — /var/named/*.db

or change the TTL of domain

replace “$TTL xxxxx” “$TTL 14400” — *.db
where “$TTL xxxxx” is your current setup TTL.

Once done, restart the named service:

service named restart

noted: it is better if you first backup all your named.db:)


Leave a comment

Your email address will not be published.