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.

Changing Master Server

Discussion in 'General Discussion' started by cretu, Jan 4, 2003.

  1. cretu

    cretu Well-Known Member

    Joined:
    Jul 21, 2002
    Messages:
    208
    Likes Received:
    0
    Trophy Points:
    16
    Hello,

    I have a question:

    - let's say I have a master server and one slave server.
    - now, I would like to change master server and copy all accounts to the new box, and would like to make this new box a master box

    How would I do it. Of course I know how to copy accounts, etc but what abount the DNS zone files - how would I move them from one box to another?

    Your questions is much appritiated.

    Regards,

    M. Cretu
     
  2. jsteel

    jsteel Well-Known Member

    Joined:
    Jul 4, 2002
    Messages:
    646
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Atlanta, GA
    I'd also like to confirmt his process. My master is experiencing servere hardware problems. We've just about got everyone moved off of it, but we still need to make one of the slaves the new master.

    I am under the assumption that I can just do this:

    1) Make sure no one performs any DNS related tasks while this is going on (i.e., add/delete subdomains, add-ons, parked domains).

    2) Ensure all slaves have sync'd with current master.

    3) Remove master entry from Setup on one of the slaves (that will become new master).

    4) Copy all of the named entries from the named.conf on the old master to the named.conf on the new master (since it has entries for 'slave'), but leaving the rndc key entries intact for the individual servers. Also modify master zone for the domain so that the IP for NS1 is now the new master's IP.

    5) Shut down old master and restart named on new master.

    6) Perform DNS Cleanup on new master.

    7) Go to all other servers and modify the master nameserver IP though WHM.

    8) Make sure resolv.conf is changed on all other servers.

    9) Establish new Trust Relationship on all other servers.

    10) Perform DNS on all other servers.

    11) Perform DNS Cleanup on all other servers.

    12) Check to make sure named.conf files on all other servers show the new IP for the master for every zone.

    13) Change IP for master nameserver with domain registrar. and pray NS2 doesn't go down while that change is propagating since the old master is shut down.

    Can anyone bless these steps?

    Jaz
     
  3. cretu

    cretu Well-Known Member

    Joined:
    Jul 21, 2002
    Messages:
    208
    Likes Received:
    0
    Trophy Points:
    16
    Hi,

    Thanks for reply.

    But wouldn't be easier to unplug the slaves, then copy over the accounts from slave onto new box. Then change NSs to new IP addresses on new master and plug slaves back.

    M. Cretu
     
  4. kwimberl

    kwimberl Well-Known Member

    Joined:
    Aug 13, 2001
    Messages:
    123
    Likes Received:
    0
    Trophy Points:
    16
    1) Make your new master a slave to the existing master. I am assuming you know the steps to do this correctly.
    2) run /scripts/dnstransfer on new master (currently slave)
    3) restart named on new master (still slave)
    4) After all zones have transfered (tail -f /var/log/messages to monitor this), remove the master IP or hostname found in /etc/wwwacct.conf (or from WHM setup) on the new master.
    5) Run /scripts/unslavenamedconf on the new master.
    6) Edit /etc/named.conf on the new master for the allow-transfer option.
    7) From WHM, setup each slave to be a slave to the new master. Do not forget to edit the IP in setup first (or in /etc/wwwacct.conf).
    8) From the root shell on each slave server, run /scripts/dnstransfer and then restart named. tail -f /var/log/messages to watch and make sure all is well.
    9) Make the original master a slave to the new master.
    10) Check the new master and make sure all is well.
    11) Change your ip with your registrar.

    We have done this numerous times like this and never had a problem. Good luck!
     
  5. jsteel

    jsteel Well-Known Member

    Joined:
    Jul 4, 2002
    Messages:
    646
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Atlanta, GA
    kwimbert,

    Thanks for the guidance. We did those tasks last night and all seemed fine, however, we just had a customer add a subdomain on his account (on one of the slave servers) and although the local WHM/CP says the subdomain has been created, it did not get added to the zone file on the slave or the new master (or anywhere for that matter). All zone files are owned by named:named and have write permissions for that user. Any ideas?
     
  6. kwimberl

    kwimberl Well-Known Member

    Joined:
    Aug 13, 2001
    Messages:
    123
    Likes Received:
    0
    Trophy Points:
    16
    Are new domains getting added (new zone files)?

    Are edits to existing zone files working correctly?
     
  7. jsteel

    jsteel Well-Known Member

    Joined:
    Jul 4, 2002
    Messages:
    646
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Atlanta, GA
    [quote:4207d242ef][i:4207d242ef]Originally posted by kwimberl[/i:4207d242ef]

    Are new domains getting added (new zone files)?

    Are edits to existing zone files working correctly?[/quote:4207d242ef]

    New domain, yes. The one above is a modifcation (since it is adding a subdomain) but it did not work. We'll continue to monitor to see if was just a glitch or if it is consistent.

    BTW, you should also modify the /etc/resolv.conf, /etc/ips.remotedns and /etc/ips.dnsmaster files to reflect the changes in nameservers.

    Thanks again for the quick guide. It definitely helps to know all the scripts. My way would have accomplished the same thing, but with A LOT MORE work! ;-)

    Jaz
     
  8. jsteel

    jsteel Well-Known Member

    Joined:
    Jul 4, 2002
    Messages:
    646
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Atlanta, GA
    Defintely a problem

    Found another problem since performing the switch. Now when I go to edit the zone files via WHM on the new master, it isn't showing the hostnames in the appropriate fields. They are there if I open them in vi though. Now it appears I'll have to do all my modifications via ssh as it appears the lack of the hostnames being filled out on the form will corrupt the zone file if I save it through WHM.

    And I've also confirmed that something is indeed broken now as another subdomain was added to a different domain last night and once again, the zone file did not get updated (neither on the local server to that domain nor the master). I've opened a support ticket as this is a MAJOR issue, but if anyone has some insight, I'd greatly appreciate it!

    Jaz
     
  9. kwimberl

    kwimberl Well-Known Member

    Joined:
    Aug 13, 2001
    Messages:
    123
    Likes Received:
    0
    Trophy Points:
    16
    That is indeed a problem.

    I would have to look at your configs to see what might be wrong. Let me know if you don't get quick response from cpanel team and I'll take a look.
     
  10. jsteel

    jsteel Well-Known Member

    Joined:
    Jul 4, 2002
    Messages:
    646
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Atlanta, GA
    I've figured out WHAT the problem is, however, figuring out WHY it happened and how to easily fix it is another story. I've opened a support ticket, but I'm not getting very far.

    Using the steps you gave me resulted in all of the zone files being re-written into a format that WHM does not appear to support. It's still a legal format, but WHM doesn't like it., so it won't modify anything. I'm also finding that certain servers are creating WHM-supported zone files when a new account gets created, but other servers are creating the oddly-formatted zone files, however, all of my servers are at the same WHM/CP revision.

    Here's an example of the old (WHM-supported) format:
    -------------------------------------------
    ; cPanel 5.x
    ; Zone file for yourdomain.com
    @ 14400 IN SOA ns1.mydomain.com. root.mydomain.com. (
    1042214229 ; serial, todays date+todays
    28800 ; refresh, seconds
    7200 ; retry, seconds
    3600000 ; expire, seconds
    86400 ) ; minimum, seconds

    yourdomain.com. 14400 IN NS ns1.mydomain.com.
    yourdomain.com. 14400 IN NS ns2.mydomain.com.
    yourdomain.com. 14400 IN A 999.999.999.999

    localhost.yourdomain.com. 14400 IN A 127.0.0.1

    yourdomain.com. 14400 IN MX 0 yourdomain.com.

    mail 14400 IN CNAME yourdomain.com.
    www 14400 IN CNAME yourdomain.com.
    ftp 14400 IN A 999.999.999.999
    -------------------------------------------


    Here's an example of the new (unsupported) format:
    -------------------------------------------
    $ORIGIN .
    $TTL 14400 ; 4 hours
    yourdomain.com IN SOA ns1.mydomain.com. root.mydomain.com. (
    1040995648 ; serial
    28800 ; refresh (8 hours)
    7200 ; retry (2 hours)
    3600000 ; expire (5 weeks 6 days 16 hours)
    86400 ; minimum (1 day)
    )
    NS ns1.mydomain.com.
    NS ns2.mydomain.com.
    A 999.999.999.999
    MX 0 mail.yourdomain.com.
    $ORIGIN yourdomain.com.
    ftp A 999.999.999.999
    localhost A 127.0.0.1
    mail CNAME yourdomain.com.
    www A 999.999.999.999
    -------------------------------------------

    WTF?!?!?!
     
  11. kwimberl

    kwimberl Well-Known Member

    Joined:
    Aug 13, 2001
    Messages:
    123
    Likes Received:
    0
    Trophy Points:
    16
    The latter should only be on secondary servers. WHM should ONLY edit the master server if it is setup properly and it should be formatted in a way that WHM likes.


    Did you run /scripts/unslavenamedconf on the new master?
     
  12. jsteel

    jsteel Well-Known Member

    Joined:
    Jul 4, 2002
    Messages:
    646
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Atlanta, GA
    Yup. Did exactly as you said. Fortunately, we made a backup of all the zones files ont he old master prior to the transition, so we've copied all those over and manually modified the serial number on thousands of them.

    so what you are saying is that the master should have the 'first' format I listed and all secondaries should have the 'second' format I listed?

    Can you paste copies of your named.ca, named.local and localhost.zone files for both your master and a slave? I see inconsistencies between them on my servers and want to get everything back to 'normal'.
     
  13. pingo

    pingo Well-Known Member

    Joined:
    Nov 16, 2002
    Messages:
    430
    Likes Received:
    0
    Trophy Points:
    16
    6) Edit /etc/named.conf on the new master for the allow-transfer option

    Thanks for the detailed guide. I'm not sure, however, how to edit named.conf for the allow-transfer option. A search for allow finds:

    controls {
    inet 127.0.0.1 allow { localhost; } keys { "rndc-key"; }; }


    Does anybody here know what to change?

    Thanks
    John
     
  14. pingo

    pingo Well-Known Member

    Joined:
    Nov 16, 2002
    Messages:
    430
    Likes Received:
    0
    Trophy Points:
    16
    Anyone!

    John
     
  15. pingo

    pingo Well-Known Member

    Joined:
    Nov 16, 2002
    Messages:
    430
    Likes Received:
    0
    Trophy Points:
    16
    I've figured out WHAT the problem is, however, figuring out WHY it happened and how to easily fix it is another story

    Yeah, the same thing happened to us. A little over 2000 dns zones. I thought that scripts available in /scripts could be relied upon. So don't do it the way suggested in this thread.

    John
     
  16. pingo

    pingo Well-Known Member

    Joined:
    Nov 16, 2002
    Messages:
    430
    Likes Received:
    0
    Trophy Points:
    16
    Hmm, oh well, I ran /scripts/fixndc and now all zones seems to be ok. I guess I were just lucky.

    John
     
  17. Valetia

    Valetia Well-Known Member

    Joined:
    Jun 20, 2002
    Messages:
    207
    Likes Received:
    1
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    So what is the actual procedure?

    Just follow the instructions earlier and then run /scripts/fixndc afterwards?
     
  18. pingo

    pingo Well-Known Member

    Joined:
    Nov 16, 2002
    Messages:
    430
    Likes Received:
    0
    Trophy Points:
    16
    No, I thought that something magical happened when I ran that script, :) but at the same time a tech found and restored a backup of the .db files, so that was the real reason.There is an incompatibily issue between different cpanel versions when you run that script so you should be aware of that. Remember to take a backup of the domain.com.db files first at least!

    John
     
  19. RogelioH

    RogelioH Active Member

    Joined:
    Jun 2, 2003
    Messages:
    41
    Likes Received:
    0
    Trophy Points:
    6
    So what will be the right full steps to changing master dns?

    thank you.
     
Loading...

Share This Page