The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Bulk DNS insert

Discussion in 'Bind / DNS / Nameserver Issues' started by e0xbr, Jul 7, 2011.

  1. e0xbr

    e0xbr Registered

    Joined:
    Jul 7, 2011
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Hello

    I have CPANEL + CentOS

    I need to multiple insert a NS record and a A record on all DNS Zones. I have a lot of zones, and to insert one by one is out of question...

    How can I do that with cpanel?


    Thanks!
     
  2. e0xbr

    e0xbr Registered

    Joined:
    Jul 7, 2011
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Nobody?
    UP
     
  3. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Hello e0xbr,

    Are you actually adding a record to all zones or changing an existing record in all zones? If you are adding a record, you could do the following:

    Code:
    cp -R /var/named /var/named.bak110713
    cd /var/named
    for x in `cat /etc/trueuserdomains | cut -d: -f1` ; do echo "$x. 86400 IN NS ns#.domain.com." >> /var/named/$x.db ; done
    for x in `cat /etc/trueuserdomains | cut -d: -f1` ; do echo "ns#.$x. 14400 IN A IP#" >> /var/named/$x.db ; done
    Please replace ns#.domain.com. with the actual nameserver name and please replace IP# with the actual IP number. Do not replace the other details.

    After doing the above, you'd want to follow the details in this forum thread on updating the serials for the zones:

    http://forums.cpanel.net/f5/how-incremental-serial-number-dns-zone-211732.html#post873142

    If anything goes wrong, you will always have /var/named.bak110713 to use to restore the prior working zones.

    Thanks.
     
  4. MojoCreations

    MojoCreations Active Member

    Joined:
    Feb 14, 2012
    Messages:
    28
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    What if i need to add multiple a-records to one dns name, what is the best way to do that?
     
  5. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Please specify exactly what needs added to what. You mention multiple A records with different IPs, but you aren't providing enough information on why each would need a different IP. The issue here is that if you need 50 different IPs for each different zone, you are probably better off doing it manually period.
     
Loading...

Share This Page