Mass update A record

pjs32

New member
Joined
Sep 2, 2021
Messages
4
Hi,
I am looking to mass update all domains A records to point to a different IP

ie. any domains that are pointing to a certain IP - I want to change that IP to a new external IP - search and replace type thing.

Any ideas?
 
You can try:

cd /var/named

sed -i 's/oldip/newip/g' domain.db

for example:

Old ip: 1.2.3.4
New ip: 5.6.7.8
domain: hi.com

sed -i 's/1.2.3.4/5.6.7.8/g' hi.com.db

if you want to apply the changes to all de zones

sed -i 's/oldip/newip/g' *.db


After that just update the serials numbers of the zones:

cd /usr/local/directadmin
echo "action=rewrite&value=named" >> data/task.queue; ./dataskq d2000
 
Back
Top