Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Change DNS zone IP for all domains

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

  1. ManXP

    ManXP Well-Known Member

    Joined:
    Feb 3, 2005
    Messages:
    62
    Likes Received:
    0
    Trophy Points:
    156
    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?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. xerophyte

    xerophyte Well-Known Member

    Joined:
    Mar 16, 2003
    Messages:
    216
    Likes Received:
    0
    Trophy Points:
    166
    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
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. ManXP

    ManXP Well-Known Member

    Joined:
    Feb 3, 2005
    Messages:
    62
    Likes Received:
    0
    Trophy Points:
    156
    Thanks for a valuable tip, I will try it
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. hostingtech

    hostingtech Member

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

    ManXP Well-Known Member

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

    crazyaboutlinux Well-Known Member

    Joined:
    Nov 3, 2007
    Messages:
    941
    Likes Received:
    0
    Trophy Points:
    66
    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

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice