Script do change DNS of all domains

silas_i

Member
Jan 6, 2009
7
0
51
Hi,

I need change all my XM Entries to yourdomain.com. acctually are hostname.domain.com.

How to do it this ?
 

Lyttek

Well-Known Member
Jan 2, 2004
775
5
168
These aren't scripts per se, but are commands you can use for just this type of thing...

This command will parse through ALL the domain files and replace the text '14400' with '304'
replace '14400' '304' -- /var/named/*.db
This command will parse through ALL domain files looking for a certain date string (anything with 2011 like 2011010101) and replace it with the given string '2011081305'
sed -i 's:2011[0-9]\{6\}:2011081305:g' /var/named/*.db
Perhaps that will get you headed in a direction that's helpful. However, if you modify a file and don't update the serial of the DNS record, you'll be out of sync with other nameservers and that can cause issues.