changing SOAs in named with large numbers of zone files
Hi, I have a DNS server running on my redhat ES2.1 box with lots of zone files. I recently decided to change the expire and minimum time limits on all of the files. I was wondering if there’s a better way to change the 400 files or so other then going through each file and individually changing every record. Thanks for your time.
|
Well, if all your files are uniform, such as my expire is set to 604800 and my minimum is set to 38400, these are all unique numbers within each file, you could do a sed to change them.
Something like this: #!/bin/sh for i in `ls *.net` do sed -e 's/604800/666666/' \ -e 's/38400/33333/' $i > blah.tmp mv blah.tmp $i done If they're not all uniform, then you can do something with head and tail and some echos...but hopefully the simple sed script will work for you. |
Thanks much. Thats exactly what i was looking for.
|
A quick one-liner in Perl:
perl -pi -e 's/oldpattern/newpattern/g' zone* This will modify them in place so make a backup copy of the files before you do this. |
All times are GMT -5. The time now is 09:27 AM. |