How to remove a few DNS records from all zone files?
Hello,
WHM stupidly without asking me added all Default nameservers into zone files of accounts i transfered to my server.
The aim is now fix the mess WHM did.
Removing whole entry lines
nsx1.hosting.com X X X IP
nsx2.hosting.com X X X IP
there is more than 100 zone files to edit. so i ask how i can remove these two whole lines automatically via linux command line from all zone files.
-
Hello, You could use the replace command. First if you haven't already done so, make a backup of the /var/named directory cp -rfpd /var/named /var/named.bak
Then you would use the replace command something like this:replace 'nsx1.hosting.com X X X IP' '' -- * replace 'nsx2.hosting.com X X X IP' '' -- *
That should do the trick. If anything goes wrong, you still have the backup.0
Please sign in to leave a comment.
Comments
1 comment