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.

DNS On 2 Hosting servers: Can i get both to respond to DNS for same domain?

Discussion in 'Bind / DNS / Nameserver Issues' started by orty, Apr 1, 2012.

  1. orty

    orty Well-Known Member

    Joined:
    Jun 29, 2004
    Messages:
    110
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Bend, Oregon
    cPanel Access Level:
    Root Administrator
    Hello there,

    Maybe this is a feature, maybe this is just wishful thinking, but here we go anyway :)

    I have two servers hosting sites. Server A has the nameservers ns1.domain.com and ns2.domain.com, and Server B has ns3.domain.com and ns4.domain.com. The bulk majority of my sites are on Server A, but a few high-load clients are on Server B. Everything's all running happy and hunky-dorry.

    For some of the clients on each server, I'd like to be able to have them list all for nameservers with their registrar (ns1-ns4), and have both servers respond with information (give them a bit of redundancy -- that's my thinking, at least, in case bind/NSD/whatever craps out). The problem is I can't get the server that isn't hosting the Web content for the domain to respond to DNS queries, even though the zone is listed in the Edit DNS area. Whether I cluster the servers or manually setup the additional zone, it doesn't seem to want to respond. It will respond fine if I send a dig query to the server hosting the site, but the server that's not hosting the site won't respond to DNS queries for domains it isn't actively hosting content for.

    So as an example:
    Server A hosts billybobswebdesign.blah

    At registrar, billybobswebdesign.blah has ns1-ns4 listed. Server A (hosting ns1-2) responds to DNS queries fine, but Server B, which has the zone files setup (either manually or via cluster but isn't hosting the site itself) but it doesn't respond.

    Is there a way to get both servers to respond to the DNS request? They're both pointing to the same IP address, in the long run, but it'd just be nice if both could respond without me having to create a dummy hosting account on the server for the domain. Is there a configuration somewhere that I need to change as I know I've gotten this to work before (at least I thought I did).

    -Jake
     
    #1 orty, Apr 1, 2012
    Last edited: Apr 1, 2012
  2. nwtg

    nwtg Active Member

    Joined:
    Dec 24, 2010
    Messages:
    34
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Portland, Oregon
    cPanel Access Level:
    Root Administrator
    Re: DNS On 2 Hosting servers: Can i get both to respond to DNS for same dom

    What you seem to be referring to is DNS clustering, which is a feature in cPanel.

    I'm not sure of your experience with this, but here's how I set mine up.

    On each of your servers, in the root directory, should be a file called '.accesshash'. Save that.

    In WHM, under "tweak settings" start by 'enable sharing nameserver IPs' on both servers (I've been told this is deprecated/unneeded but I did it anyhow).

    Then on your primary machine (Server A) you'll go into "Cluster/Remote Access" and make sure that clustering is enabled. Then you'll "add a new server to the cluster." -- click "Configure"

    In the new window, you'll be presented with three config boxes. The first field, you'll add the hostname of "Server B", the "remote server username" would be "root", and under "Remote Server Access Hash", paste the contents of .accesshash from "Server B" into this field. Configure its DNS role accordingly (I use "synchronize changes"). Then click "submit." If the access hash is correct, you should receive a message that "Server B" has been added as a cluster member.

    Then, move over to your "Server B" and follow the same steps, using the .accesshash from the root directory of "Server A."

    If either of the servers throw an error, you'll likely have to regenerate a remote access key on each server.

    If both machines are successfully clustered, you can then sync all DNS zones either in WHM or with this command:

    Code:
    <root@charoite</etc># /usr/local/cpanel/scripts/dnscluster syncall --full
    Syncing Zones to all machines in cluster....(full)...............................Done
    You can then check /var/named on both servers and the DNS zones should now be on both servers.

    Now, it doesn't stop there. Just because the zones are synced up, doesn't make a whit of difference until you add the secondary NS records to the domains that you want to have utilizing this feature. Once you're finished with that, run "/usr/local/cpanel/scripts/dnscluster syncall --full" a final time, and you should be set to go, apart from updating the nameservers at the registrar.

    Would be happy to help if you run into anything. Good luck! -John
     
    #2 nwtg, Apr 1, 2012
    Last edited: Apr 1, 2012
  3. nwtg

    nwtg Active Member

    Joined:
    Dec 24, 2010
    Messages:
    34
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Portland, Oregon
    cPanel Access Level:
    Root Administrator
    Re: DNS On 2 Hosting servers: Can i get both to respond to DNS for same dom

    Then as a final confirmation, you can use IntoDNS to verify your settings:
    Should read similar to the screenshot of my config:

    dns.jpg
     
  4. orty

    orty Well-Known Member

    Joined:
    Jun 29, 2004
    Messages:
    110
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Bend, Oregon
    cPanel Access Level:
    Root Administrator
    Re: DNS On 2 Hosting servers: Can i get both to respond to DNS for same dom

    I generally get the access key and do everything by WHM, but looking through this, I think the missing step was adding the secondary NS records to some of the domains. I'll give that a whirl and get back to you after I finish some server moves this week.
     
  5. LeadDogGraphics

    LeadDogGraphics Well-Known Member

    Joined:
    Feb 25, 2012
    Messages:
    97
    Likes Received:
    1
    Trophy Points:
    8
    Location:
    West Palm Beach, FL
    cPanel Access Level:
    Root Administrator
    Re: DNS On 2 Hosting servers: Can i get both to respond to DNS for same dom

    Subscribed, I would like to know how it turns out. I am too looking into this option for redundancy.
     
  6. orty

    orty Well-Known Member

    Joined:
    Jun 29, 2004
    Messages:
    110
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Bend, Oregon
    cPanel Access Level:
    Root Administrator
    Re: DNS On 2 Hosting servers: Can i get both to respond to DNS for same dom

    After moving some sites around last night, and verifying that the NS records in each zone were setup for all four name servers (two on each server) and the two servers were clustering properly, it appears things are working now. Don't know what the issue was, but I'm pretty sure my lack of having the NS records in each zone file setup properly was causing the issue. Will report back if I have any more issues, but I have other fires I have to put out this week first :)
     
  7. nwtg

    nwtg Active Member

    Joined:
    Dec 24, 2010
    Messages:
    34
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Portland, Oregon
    cPanel Access Level:
    Root Administrator
    Re: DNS On 2 Hosting servers: Can i get both to respond to DNS for same dom

    Very glad that you got this resolved. Adding the additional NS to each zone was the likely fix.

    If you want more than DNS clustering (a true fault tolerant configuration) between your machines, you can always utilize DRBD+ Heartbeat for a "failover" environment. Two or more high availability, beefy Linux servers (I used Debian on these nodes, we'll call them NODE01 and NODE02) with proper DRBD configuration. Then set up a hypervisor (Xen in my case) followed by a virtual machine with a cPanel supported OS.

    Think of it like a network-RAID.. DRBD runs on the two physical nodes replicating the data from the cPanel VM in real-time.

    With this type of setup, if NODE01 went down hard (say, a motherboard failure for example), DRBD would recognize this and fail to NODE02, thus becoming the node responsible for keeping the cPanel VM up and running, practically eliminating end-user downtime.

    This is simply an overview of a very detailed configuration. There are several things to consider...most notably that this type of setup is not supported by cPanel, so maintaining the two DRBD nodes would be up to you and your server provider. Also depending on the type of configuration it can get a little pricey, if you're hosting < 150 domains across a couple of dedicated machines, you're probably okay where you are.

    @orty - I just now realized that you're also an Oregonian! If you want some additional info, feel free to drop me a line!

    (support_@_nwtechgroup.com)
     
    #7 nwtg, Apr 15, 2012
    Last edited: Apr 16, 2012
  8. orty

    orty Well-Known Member

    Joined:
    Jun 29, 2004
    Messages:
    110
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Bend, Oregon
    cPanel Access Level:
    Root Administrator
    Re: DNS On 2 Hosting servers: Can i get both to respond to DNS for same dom

    Born and raised in Bend, but have a bunch of relatives and friends up in your neck of the woods. :)
     
Loading...

Share This Page