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.

Need advise on cPanel DNS cluster setup

Discussion in 'Bind / DNS / Nameserver Issues' started by Sindre, Mar 2, 2009.

  1. Sindre

    Sindre Well-Known Member

    Joined:
    Aug 25, 2008
    Messages:
    46
    Likes Received:
    0
    Trophy Points:
    6
    Hello,

    I currently have two dedicated servers running WHM/cPanel, with separate name servers on each. For customer convenience I would rather provide my clients with a single pair of name servers regardless of which server they are hosted on. And for better redundancy, I am thinking of setting up ns1.* on server 1 and ns2.* on server 2.

    As I understand, this can be accomplished with the clustering feature in cPanel (?).

    First, would you recommend this setup? Will all the zones be stored on all servers in the cluster? I am a bit concerned if this will have a negative impact on performance as there will be a lot more zones on each server. (More servers will possibly be added later).

    Secondly, how would I configure this technically? So far, this is how I think it should be done, but I am not sure:

    • Set ns1.* and ns2.* as primary/secondary nameservers in Basic cPanel/WHM Setup on both servers.
    • On server 1, set A record for ns2.* to IP of Server 2. Assign IP to ns1.* (from Server 1 pool), and add matching A entry.
    • On server 2, set A record for ns1.* to IP of Server 1. Assign IP to ns2.* (from Server 2 pool), and add matching A entry.
    Provided the actual name servers are registered with correct IPs, the name server setup should now be complete, right?

    Then, in order for the two name servers to communicate I would need to enable clustering:

    • Enable DNS Clustering on both servers.
    • Add IP address of Server 2 to cluster on Server 1, and vice versa.
    • Now, the question is: what should I select for "DNS Role" on each server? Synchronize or Standalone?

    I have read the DNS Clustering Quick-Start Guide, but I'am still unsure how to do this the best way and maintaining best performance.

    Remember, both servers act as both web and DNS servers.

    I know I could just go the "trial and failure" path, but I would rather learn how the clustering works and get it properly in the first place, especially as I have live sites on one of the servers.

    Any advise would be appreciated!

    Thank you,
    Sindre
     
    #1 Sindre, Mar 2, 2009
    Last edited: Mar 2, 2009
  2. wonker

    wonker Active Member

    Joined:
    Dec 5, 2007
    Messages:
    29
    Likes Received:
    2
    Trophy Points:
    3
    As far as I understand, you update the zones on ns1 and ns2 updates itself on ns1.

    With this setup you do not need to run a dns server on the servers that are not name servers.

    Such a setup can help you gain power on other servers and also help you move one site to a new server without waiting for a dns change.

    Maybe someone will correct me but also from what I understand, you set the dns servers as synchronise and the web servers as standalone.

    I've not yet done such a setup but am thinking about doing so in the near future.

    I believe that you will have a few extra ms while accessing a site but not a big enough difference to notice it and in exchange you will free some power from your servers which could actually speed up the time to show a web page.

    I haven't tried such a setup yet but I will be setting up something like this in the near future.

    I have a question though if someone who has a setup like this comes by, I don't know how much power is actually used or needed by a dns server. What processor/ memory etc would be best for maybe 10 web servers with 200 sites each ? should I go for a small core2duo with 2 gigs of ram (cheaper) for a dns server like this or maybe need something bigger like a dual xenon with 8 gigs of ram ?

    Edit : sorry I didn't read your questions well enough .. if you've only got two servers and can not justify the need of dns servers then I'm not sure that this is the best solution. I'm waiting to have quite a few servers before geting two standalone dns servers.
     
    #2 wonker, Mar 3, 2009
    Last edited: Mar 3, 2009
  3. Sindre

    Sindre Well-Known Member

    Joined:
    Aug 25, 2008
    Messages:
    46
    Likes Received:
    0
    Trophy Points:
    6
    Thanks for the reply.

    I have now set up two servers in a cluster and it works fine. However, I had to set the DNS role to "Synchronized" on both servers for the zones to propagate on both name servers. I realize this is not the optimal configuration, but until I can afford a pair of dedicated name servers I think it works fine.

    If anyone has any comments, please share.
     
  4. DaveUsedToWorkHere

    DaveUsedToWorkHere Well-Known Member

    Joined:
    Dec 28, 2001
    Messages:
    689
    Likes Received:
    1
    Trophy Points:
    18
    The best setup is going to be one where your webservers sync directly to your nameservers. Like so


    Web1-X -----------> NS1
    L---------->NS2



    This of course requires 2 nameservers that are not also web servers. This means you would set the web servers to synchronize with the nameservers and the nameservers to be standalone. Additionally, there is no need to run DNS locally in this case. Therefore, you'd be pushing all new/updated zones to both nameservers when there are DNS changes. Your nameservers would hold all the DNS records.

    This works well with BIND up to about 80,000 zone files. After that, it can get slow as BIND loads all zones upon restart which can slow things down when you have frequent DNS edits (which require BIND to restart for the changes to take effect). We're looking into some options to improve large clusters.



    If you only have 2 servers, you should set both to synchronize like this:



    NS1 + Web1 <-----> NS2 + Web2

    This ensures all DNS records exist on both machines.


    The primary rule when setting up DNS clusters is to keep the amount of 'hops' a zone file has to travel to a minimum. Therefore, you should always sync your web boxes directly to your nameservers. Adding additional servers in between like so:


    NS2 <------- NS1 <--------- Web1-4

    Will slow the process of each change by 1/2 and potentially increase load as the DNS synchronization process on WebX will not be complete until all the reads and writes are done on both NS1 and NS2. Even worse, if you have multiple hops on the Web box side as well, you can risk slowing down the process 4x or even more and cause load spikes during synchronization.


    In short, you're good to go for now. As you expand, you may wish to get some VPSes running DNS ONLY (free) to use as your nameservers and set up the first type of clustering noted above.
     
  5. Sindre

    Sindre Well-Known Member

    Joined:
    Aug 25, 2008
    Messages:
    46
    Likes Received:
    0
    Trophy Points:
    6
    Thanks Dave for your thorough reply. I appreciate!
     
  6. rhearn

    rhearn Registered

    Joined:
    Jun 13, 2007
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    Adding WHM server #3

    Hi,

    Thanks for the info in this post so far, it has been very helpful in understanding the DNS Clustering approach.

    I am currently at the stage you have described as the "first" scenario in the last post from cpaneldave, having 2 webservers each with their own nameservers and syncing with each other in a DNS cluster, namely:

    NS1/NS2 + Web1 <-----> NS3/NS4 + Web2

    I think that 2 nameservers specified for each webserver is a bit OTT, but I set this up a while ago. Can you advise if there is a reason for or against using more than 1 NS entry per server?

    I have been specifying all 4 nameservers for all customer domains (at the registrar) being added to either webserver.

    I am now reviewing adding a 3rd, 4th etc.etc webserver but as I cannot add any more nameservers (to the domain records), I need to review how to setup the DNS Cluster to include these additional webservers.

    1. Can you please confirm that if I leave the current NS1&NS2 on WEB1 and NS3&NS4 on WEB2 what I need to add to the DNS settings on WEB3, WEB4?

    - I assume that if WEB3 and WEB4 are going to use Nameservers that are setup on WEB1 and WEB2, that I do not add any Nameserver IPs in WHM under Networking Setup?

    -Do I need to maintain anything on the existing WEB1 and WEB2 DNS zone entries/ns records or Nameserver entries in WHM?

    2. I am assuming that to increase the redundancy potential of this setup, I could update WEB1 to use NS1 only, WEB2 to use NS2 only, WEB3 to use NS3 only and WEB4 to use NS4 only. I realise I would need to setup all 4 servers to Sync in the DNS cluster with each other so all servers have a direct sync relationship to all other servers.

    -Is this advisable from a performance perspective? It keeps the hops low, but it might not help overall.

    -Or is it better to generally keep the DNS servers to say 2 distinct WEB or DNS only WHM servers, and have other WEB servers sync to them for DNS?

    I apologise if these are rudimentary questions but I would appreciate some clarification before leaping in.

    Thanks,
    Rich.
     
  7. DaveUsedToWorkHere

    DaveUsedToWorkHere Well-Known Member

    Joined:
    Dec 28, 2001
    Messages:
    689
    Likes Received:
    1
    Trophy Points:
    18
    Rich,
    Here's my advice:

    Drop NS2 and NS4. Since both NS1 and NS2 are running on web1 and NS3 and NS4 are running on web2, you really only have 2 nameservers. This is because both NS1 and NS2 are using the same BIND/NSD installation on web1 and likewise with NS3 and NS4.

    Starting out, it's fine to put 2 nameservers on 1 box (as 2 NS records are the minimum req). Since the box may go down, both nameservers would go down and therefore both NS1 and NS2 would be useless.

    When getting bigger, it's ideal to split your namservers to separate boxes so that if one box goes down DNS is still being served. Ideally, you'll want NS1 and NS2 (more than 2 isn't all that necessary unless you have a lot of downtime issues) split onto 2 different boxes and then just add NS1 and NS2 as your primary and secondary nameservers in WHM.

    As you get large, you may wish to consider moving DNS off your web boxes all together. If you're large and have lots of queries, you can reduce load on your web boxes by getting say 2 VPSes and putting DNS ONLY (free) on them and making them NS1 and NS2. This will also help stability if your web servers are highly loaded.
     
  8. rhearn

    rhearn Registered

    Joined:
    Jun 13, 2007
    Messages:
    4
    Likes Received:
    0
    Trophy Points:
    1
    HI Dave,

    Thanks for your comments, all very helpful.

    Assuming I use just ns1 (on web1) and ns2 (on web2), could you please confirm what I should do when setting up the "other" webservers that will host domains being controlled by these nameservers?

    1. If I leave NS1 on WEB1 and NS2 on WEB2 what I need to add to the DNS entries on WEB3, WEB4?

    - I assume that if WEB3 and WEB4 are going to use Nameservers that are setup on WEB1 and WEB2, that I do not add any Nameserver IPs in WHM under Networking Setup?

    -Do I need to maintain anything on the existing WEB1 and WEB2 DNS zone entries/ns records or Nameserver entries in WHM?

    A final couple of questions on the cluster setup:

    In the "DNS cluster setup" on both WEB1 and WEB2 WHM - I assume I add entries for WEB3 (and WEB4) - and set them to "synchronise changes"?

    Do I need to add anything to the DNS cluster WHM setup on WEB3 and WEB4, as they will just be receiving updates from WEB1 and WEB2?

    Is there any problem in having NS1, NS2, NS3 and NS4 listed on my customer domain entries at the registrar, if only NS1 and NS2 are currently active in this new setup? I guess this is a more general DNS question, but maybe you can answer it?

    Thanks again for all your help and guidance, appreciate CPANEL's support as always.

    Rich

    Many thanks,
    Rich
     
  9. DaveUsedToWorkHere

    DaveUsedToWorkHere Well-Known Member

    Joined:
    Dec 28, 2001
    Messages:
    689
    Likes Received:
    1
    Trophy Points:
    18
    Just add NS1 and NS2 as your primary nameservers on WEB3 and WEB4 and the DNS will be set up for you. If the DNS already exists, change the domain.com 86400 IN NS xx.xx.xx lines to domain.com 86400 IN NS NS1 and domain.com 86400 IN NS NS2

    that is correct

    You can leave these records alone. As long as your nameservers resolve, that is all that is needed.


    On WEB1 and WEB2 add them and set them to standalone.

    on WEB3 and WEB4 add WEB1 and WEB2 and set them to sync changes. The option determines what to do with local NS records (to sync them to the remote server or not)

    This is not an issue but it's recommended to remove them. When doing a lookup, servers should try to hit NS1 first, then NS2, etc so as long as NS1 and NS2 are up, there should be no issue.


    Glad to be of help!
     
Loading...

Share This Page