Mass Updated DNS For All Users

GaMerZ

Verified User
Joined
Mar 16, 2006
Messages
10
Hi All,

Is there anyway I can mass update the dns for all the users? For example changing ns1.abc.com to ns3.abc.com, ns2.abc.com to ns4.abc.com?
 
Not thru DA itself, but you can use perl to mass edit.

It's 2:21am, so forgive me if I don't get this syntax correct from memory.

Code:
cd /var/named
perl -pi -e 's/ns1.abc.com/ns3.abc.com/' *.db
service named restart (or however you wish to restart)

That should change ns1.abc.com to ns3.abc.com. Edit as you please.
 
The above script will NOT update the serial number. To restart the serial number you need to not only restart, but also update the serial number:
Code:
# echo "action=rewrite&value=named" >> /usr/local/directadmin/data/task.queue[/quote]
Note that the above will update the serial numbers within one minute, and then restart BIND about a minute later.

Note that the [i]#[/i] is NOT typed; it means you have to do it as root.

Jeff
 
Yup, forgot to add the rewrite to the DA task queue. Thx Jeff.
 
Back
Top