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.

Change DNS zone IP for all domains

Discussion in 'Bind / DNS / Nameserver Issues' started by ManXP, May 18, 2010.

  1. ManXP

    ManXP Well-Known Member

    Joined:
    Feb 3, 2005
    Messages:
    62
    Likes Received:
    0
    Trophy Points:
    6
    I'm moving accounts to new server, and if I only change nameserver IPs with domain registrar, some visitors will still be pointed to old IPs for a while (while their ISP updates DNS).

    So I want to change IPs of all domains (including www, ftp, mail, etc.) to IP address of new server right after accounts transfer, so even if some visitors access old server, they will be redirected to new IPs immediately.

    How could I change IPs of all domains easily?
     
  2. xerophyte

    xerophyte Well-Known Member

    Joined:
    Mar 16, 2003
    Messages:
    216
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Canada
    do the following
    1) make backup copy of your zones folder cp -a /var/named /var/named.backup

    2) Change into your zone folder cd /var/named ( or /var/named/chroot/named)

    3) use the perl to replace the old ip with new ip

    perl -pi.bak -e "s/[oldip]/[newip]/g" *.db

    4) make sure all the ip changed on the zones and remove the .bak files

    hope that helps
     
  3. ManXP

    ManXP Well-Known Member

    Joined:
    Feb 3, 2005
    Messages:
    62
    Likes Received:
    0
    Trophy Points:
    6
    Thanks for a valuable tip, I will try it
     
  4. hostingtech

    hostingtech Member

    Joined:
    Feb 4, 2010
    Messages:
    21
    Likes Received:
    0
    Trophy Points:
    1
    You will also need to update serial number for all zones, some perl or sed based command can help with that.
     
  5. ManXP

    ManXP Well-Known Member

    Joined:
    Feb 3, 2005
    Messages:
    62
    Likes Received:
    0
    Trophy Points:
    6
    Could you tell me what needs to be done exactly, please? What values should I set?
     
  6. crazyaboutlinux

    crazyaboutlinux Well-Known Member

    Joined:
    Nov 3, 2007
    Messages:
    938
    Likes Received:
    0
    Trophy Points:
    16
    In this case i want to change only for reseller account

    there is a reseller account name xyz on our server & 30 cpanel accounts under that reseller we have given different NS to that reseller account & now i want to change NS for that xyz reseller account & 30 cPanel account under that

     
Loading...

Share This Page