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.

Switching to new DNS nameservers

Discussion in 'Data Protection' started by chad101, Sep 8, 2008.

  1. chad101

    chad101 Active Member

    Joined:
    Jun 17, 2006
    Messages:
    43
    Likes Received:
    0
    Trophy Points:
    6
    I have almost 74 sites that are using name servers from a domain that is about to expire...

    I have another domain that I would like to use just for the DNS name servers (i.e NS1.MYDOMAIN.COM etc)

    What is the easiest way to switch all 74 accounts to the new DNS name servers? Will I have to edit all 74 accounts individually?
     
  2. Vision

    Vision Active Member

    Joined:
    Mar 18, 2002
    Messages:
    35
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    If you have already setup the new nameservers and have ssh access you can go to /var/named and type
    Code:
    perl -pi -w -e 's/ns1.oldnameserver.com/ns1.newnameserver.com/g;' *.db
    Warning : This will modify all the zone files of the server so backup those files before!
    Restart named and wait for propagation.
     
  3. chad101

    chad101 Active Member

    Joined:
    Jun 17, 2006
    Messages:
    43
    Likes Received:
    0
    Trophy Points:
    6
    I don't know if that option still exsits...

    I haven’t tried the above cmd yet.

    This is what I have done so far.
    NOTE: everything is setup correctly with my registrar

    WHM >> Nameserver IPs (I clicked the red X to delete the two old nameservers).

    WHM >> DNS Functions >> Delete a DNS Zone (Deleted my old name servers)

    WHM >> Basic cPanel/WHM Setup (typed in my new nameservers and assigned the IP address to each one)

    I clicked on "Add an A entry for nameserver" and I received this error:
    "Adding an A entry for nameserver ns1.freepeoplehost.com
    Sorry, that's an invalid domain
    "


    That's as far as I got before I reviewed your post. I no longer have my old dns zones so I don’t know if the above command will work? I’m not sure why WHM is complaining about the invalid domain either
     
  4. Vision

    Vision Active Member

    Joined:
    Mar 18, 2002
    Messages:
    35
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    It would be much easier if you hadn't deleted the old nameservers. Anyway from the steps you mentioned i understand that you deleted only the zone files of the old nameservers and not accounts zone files.

    First of all you have to create the A entry in the zone file of your domain. In your case find the zone file of freepeoplehost.com and add A entries for ns1 and ns2.

    The cmd i posted will work and modify all the zone files you have in the server. It's a quicker way instead of Editing one by one the 74 Zone files and modifying the nameservers (from old to new).
    Also keep in mind you have to modify the DNS with your registrar for each domain.
     
Loading...
Similar Threads - Switching DNS nameservers
  1. trs
    Replies:
    1
    Views:
    213
  2. pabloafain
    Replies:
    3
    Views:
    340

Share This Page