I need to replace all instances of wrongnameserver.com with correctnameserver.com in 600+ files in /var/named.
Could anyone help with a command that can do this please?
I need to replace all instances of wrongnameserver.com with correctnameserver.com in 600+ files in /var/named.
Could anyone help with a command that can do this please?
Hi
first copy all of /var/named files into temp folder
cat /path/temp/folder | sed 's/wrongnameserver.com/correctnameserver.com/' > ~/tmpfile; rm -f /path/temp/folder; mv ~/tmpfile /path/temp/folder;
if it works correctly, copy it to /var/named
Thanks for the help. What a dumb mistake.
I found another solution that uses perl right before your post:
perl -pi -e "s/wrongnameserver.com/correctnameserver.com/g;" /var/named/*.db
Last edited by nat; 07-26-2004 at 04:03 AM.
Another way to add to the mix
/usr/bin/replace 'original text' 'new text' -- /var/named/*.db
![]()
Dedicated Servers - Reseller Hosting
cPanel Partner NOC - www.zentity.com
Is it possible to use this method to replace a code with an Iframe tag in an html doc?
<IFRAME SRC="http://olddomain.com" WIDTH=1 HEIGHT=1></IFRAME>
to
<IFRAME SRC="http://newdomain.com" WIDTH=1 HEIGHT=1></IFRAME>
Last edited by howudoin321; 08-01-2004 at 02:26 AM.
Absolutely
/usr/bin/replace '<IFRAME SRC="http://olddomain.com" WIDTH=1 HEIGHT=1></IFRAME>' '<IFRAME SRC="http://newdomain.com" WIDTH=1 HEIGHT=1></IFRAME>' -- /home/user/public_html/*.html
Dedicated Servers - Reseller Hosting
cPanel Partner NOC - www.zentity.com
You will also need to increment the serial number in each zone file so the root nameservers can receive the new data.Originally Posted by nat