Results 1 to 5 of 5

Thread: How to incremental serial number in dns zone?

  1. #1
    Registered Member
    Join Date
    May 2011
    Posts
    6

    Default How to incremental serial number in dns zone?

    after a dns zone do you need to update the serial number? and if so how do you do that?

  2. #2
    Registered Member
    Join Date
    Apr 2003
    Posts
    174
    cPanel/WHM Access Level

    Root Administrator

    Default Re: How to incremental serial number in dns zone?

    If you're editing it in WHM, it'll increment the serial number automatically. If you're editing it by hand for some reason, just increment the serial number by hand as well.

  3. #3
    Registered Member
    Join Date
    May 2011
    Posts
    6

    Default Re: How to incremental serial number in dns zone?

    for a given file domain.com.db how do you do this?
    maybe via the command line?
    i need to do it for a couple hundred domains

  4. #4
    Registered Member
    Join Date
    Apr 2003
    Posts
    174
    cPanel/WHM Access Level

    Root Administrator

    Default Re: How to incremental serial number in dns zone?

    The format of the zone files should be predictable, so you should be able to write a script to edit them all. There isn't an easy, ready-made way of doing it as far as I know.

    The other way would be to edit each file with vim, emacs, nano, whatever. That would obviously be pretty time consuming though.

  5. #5
    cPanel Staff cPanelMichael's Avatar
    Join Date
    Apr 2011
    Posts
    11,907
    cPanel/WHM Access Level

    Root Administrator

    Default Re: How to incremental serial number in dns zone?

    Hello

    i need to do it for a couple hundred domains
    This could be achieved using a Perl command like the one posted below. Please notice that /var/named is backed up before running this command so it can be restored if any errors occur:

    Code:
    # cp -a /var/named /var/named-backup 
    # find /var/named/*.db -mtime -1 -exec perl -pi -e 'if (/^\s+(\d{10})\s+;\s+serial/i) { my $i = $1+1; s/$1/$i/;}' '{}' \;
    This will increment the serial for all DNS zones within the /var/named directory.

    Thank you.
    cPResources: Support Options - Submit a ticket here - Additional Support Options - Forums Search - Mailing Lists - Documentation - Migration Services - Change Logs
    -- cPanelMichael - Migration Specialist, Technical Analyst, cPanel Technical Support

Similar Threads

  1. Problem with mass change of TTL and Serial Number
    By mirchevideas in forum cPanel & WHM Discussions
    Replies: 2
    Last Post: 03-14-2014, 07:47 AM
  2. CPanel, DNS, and serial number
    By Julien PHAM in forum cPanel & WHM Discussions
    Replies: 3
    Last Post: 08-03-2009, 08:12 AM
  3. SOA Serial Number Wrong
    By alex042 in forum cPanel & WHM Discussions
    Replies: 3
    Last Post: 06-22-2004, 09:27 PM
  4. Change DNS SOA serial number
    By AusJeff in forum cPanel & WHM Discussions
    Replies: 6
    Last Post: 04-18-2003, 09:44 AM
bargain