#1 (permalink)  
Old 06-30-2009, 10:14 AM
Registered User
 
Join Date: May 2003
Posts: 79
movielad
Changing the NS records for multiple zones

Hello,

I have 323 DNS zones on a cPanel server whose NS records I need to change within the zones themselves. Is there a quick 'n' dirty way of applying multiple changes across DNS zones?

Thanks,

Martyn
__________________
Memset Dedicated Hosting
Managed, dedicated and VPS systems
http://www.memset.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 06-30-2009, 12:34 PM
cPanel Partner NOC
 
Join Date: Jul 2005
Location: New Jersey, USA
Posts: 387
PlatinumServerM is on a distinguished road
If you want to do a from -> to change then you can use the replace command

replace fromxxxx toxxxx -- /var/named/*

Make a backup first before doing that
tar cf /var/namedbackup.tar /var/named
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 06-30-2009, 02:52 PM
Registered User
 
Join Date: May 2003
Posts: 79
movielad
Thanks. I had quite forgotten about /var/named/*.
__________________
Memset Dedicated Hosting
Managed, dedicated and VPS systems
http://www.memset.com
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 07-01-2009, 01:16 AM
Senior Member
 
Join Date: Jun 2005
Location: Area 51
Posts: 1,535
Spiral is on a distinguished road
Thumbs up

Just a little bit cleaner run of the same command written for fewer unintended
side effects than what PlatinumServerM had in good faith posted above ....

Code:
# replace '(old string)' '(new string)' -- /var/named/*.db
You can run this putting whatever you want for (old string) and (new string)
respectively and all instances of those strings will be updated in your DNS
zone files on your server.

Don't forget to update the serial number on your zone files and restart
your "named" service to make the changes effective:
Code:
# sed -i 's/200[0-9]\{7\}/2009063010/g' /var/named/*.db
# service named restart
# service named status
(Incidentally the serial number in the example above is one you might use for updating all the
zone files to a valid serial number for the date this post was made and runs in the
format of "yyyymmddee" where y= year, m = month, d = day, and e = edit number for day)


.
__________________
[b][color="Blue"]Server Support[/color]: [color="Red"]Server consulting, security, and management![/color][/b]

Last edited by Spiral; 07-01-2009 at 01:33 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Need a simple way to change MX records on all dns zones Pyro411 cPanel and WHM Discussions 2 10-28-2009 11:00 AM
Changing MX/A records andrewclure cPanel Newbies 1 01-30-2009 05:23 PM
Automatic massive add of SPF records on all existing domain zones COBRAws cPanel and WHM Discussions 6 09-21-2007 08:05 PM
Change multiple DNS zones ruber cPanel and WHM Discussions 2 07-06-2007 10:12 AM
Changing 'A Records' in cPanel ganeshn11 cPanel and WHM Discussions 0 05-05-2007 03:07 PM


All times are GMT -5. The time now is 10:57 AM.


Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
© cPanel Inc