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.

How do I get DNS sync to work automatically?

Discussion in 'Bind / DNS / Nameserver Issues' started by Stefaans, Jul 9, 2003.

  1. Stefaans

    Stefaans Well-Known Member

    Joined:
    Mar 5, 2002
    Messages:
    451
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Vancouver, Canada
    I have two servers, the one acting as slave DNS server for the other. I have the trust relationship set up and DNS has been synchronizinging perfectly until last week.

    At the moment the DNS does not synchronize automatically any more. I can do a /scripts/dnstransfer and "Synchronize DNS Records with Primary Nameserver" in WHM just fine. Only problem is that the auto updates do not work. It's not like its doing it hours later (zone refresh time), it's simply never doing it by itself.

    I have tried the following:
    * Upgraded bot servers to Cpanel 7.1.8-R45
    * Did the "Establish a Trust Relationship with a Primary Nameserver" again

    I guess I could schedule a cron job, but surely there should be a built in mechanism to trigger auto DNS synchronization.

    Your advice on where I should look next will be much appreciated :)
     
    #1 Stefaans, Jul 9, 2003
    Last edited: Jul 9, 2003
  2. Dillard

    Dillard Well-Known Member

    Joined:
    Feb 26, 2003
    Messages:
    114
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    The Netherlands
    Same here!

    Same problem here!

    It starts (I think) after I delete a zone (doesn't matter on the master or slave).

    Then somehow the sync is broken :( Took me several hours before I figured out that executing /scripts/dnstransfer is temp. solving my problem.

    I've recreated SSH identities, Re-established the Trust etc. .. All done that, but this issue remains..

    For now I can manage by executing a cronjob every somemany hours, but I would like to hear, how I can solve this the nice way..

    cPanel.net Support Ticket Number:
     
  3. Stefaans

    Stefaans Well-Known Member

    Joined:
    Mar 5, 2002
    Messages:
    451
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Vancouver, Canada
    I have also created a cron jon with /sripts/dnstransfer as an interim solution :rolleyes:

    cPanel.net Support Ticket Number:
     
  4. cyon

    cyon Well-Known Member
    PartnerNOC

    Joined:
    Jan 15, 2003
    Messages:
    320
    Likes Received:
    0
    Trophy Points:
    16
    exactly same problem here!

    I hope that one of the developers can give us a solution soon!

    Thanks in advance..

    Dave.

    cPanel.net Support Ticket Number:
     
  5. cass

    cass Well-Known Member

    Joined:
    Jul 17, 2002
    Messages:
    354
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Argentina/USA/Mexico
    3 easy steps to run Primary/Secondary DNS.

    So... let's start with the lesson...

    1) In SECONDARY Server, you need to setup the Primary as the master nameserver.
    WHM -> Server Setup -> Edit Setup -> Master Nameserver = IP

    2) In SECONDARY Server, entablish the trust...

    WHM -> DNS Functions -> Establish a Trust Relationship with a Primary Nameserver = Put Root Password.

    3) In PRIMARY Server

    WHM -> Cluster Functions -> Configure Cluster -> Put the IP, then it ask for the "Server Remote Access Key" of the SECONDARY Server (WHM -> Setup Remote Access Key, copy without begin/end tags)

    Now just do the syncronize from the secondary and Voilá!

    Now you want to TEST it ...
    1) Create an account on primary server whm, it should add it to the secondary DNS (and to primary too)
    2) Create an account on secondary server whm, it should add it to primary DNS (and to secondary too)
    3) Delete the account on primary server whm it should delete the zone on the secondary DNS too.
    4) Delete the account created on secondary server whm, it should delete the zone on the primary DNS too.

    If you have any problem ... contact your support :rolleyes:
    it should work :p

    Note: for this to work the way it's supposed to do, you should setup ALL your domains with NS1.yourdomain.com (with a IP of the primary Server) and NS2.yourdomain.com (with a IP of the secondary Server).
    In case your primary DNS fail ... your secondary DNS will resolve the domain. (so the web will not work, but the domain will still resolve) ... would be nice to still have mail, doesn't?
    I have just one question.... if primary dns fails, and you (or the server automatically) tries to sync with primary and primary does not respond for XX period of time... will the zones on secondary still be there? or will they be deleted after XX hours... days?


    A litle Off Topic ... if you are interested on this ... maybe are interested on a Secondary MX dont you?...
    Anyone have an idea how to setup this automatically on CPANEL Boxes? (like having a server to do secondary DNS and secondary MX too... whould be great) But I think this have to do with the way CPANEL setups the dns zones ....


    Regards.

    cPanel.net Support Ticket Number:
     
  6. cass

    cass Well-Known Member

    Joined:
    Jul 17, 2002
    Messages:
    354
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Argentina/USA/Mexico
    Oh Note.... for all this to work, you need to be running SSH on port 22, and allowing ROOT Login!

    cPanel.net Support Ticket Number:
     
  7. cyon

    cyon Well-Known Member
    PartnerNOC

    Joined:
    Jan 15, 2003
    Messages:
    320
    Likes Received:
    0
    Trophy Points:
    16
    thx for your instructions.
    we ve done all that before, but this doesn't solve the problem. the problem is the broken sync between both servers, meaning that the dns zones aren't being updated on the second server.

    dave.

    cPanel.net Support Ticket Number:
     
  8. Dillard

    Dillard Well-Known Member

    Joined:
    Feb 26, 2003
    Messages:
    114
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    The Netherlands
    I don't think adding the SECOND server into the cluster has anything to do with it. If you look at the scripts, DNS has it's own generated SSH-key, which it uses to login and adjust your SECONDARY named.conf.

    By doing this, the DNS daemon will try to look and find the master and the synchronize the zone-file.

    Somehow, sometimes the SSH-update scripts get broken.

    After some experimenting it seems to happen ONLY when I manually add or delete zones, so without the creation of a account. This seems to be a 'bug'

    Can anyone confirm this ?

    cPanel.net Support Ticket Number:
     
  9. MN-Robert

    MN-Robert Well-Known Member

    Joined:
    Feb 19, 2003
    Messages:
    203
    Likes Received:
    0
    Trophy Points:
    16
    By the way, if you have this setup theirs a bug with addon domains. If theirs an account on the slave server with an addon domain and the user removes it you need to go into the slave and remove the zone from /var/named/ because cpanel is stupid and doesnt sync the zones between the primary and slave (Ie it removes it from primary but does not remove it from slave)

    cPanel.net Support Ticket Number:
     
  10. cyon

    cyon Well-Known Member
    PartnerNOC

    Joined:
    Jan 15, 2003
    Messages:
    320
    Likes Received:
    0
    Trophy Points:
    16
    I look realy forward to a solution for that bug..

    cPanel.net Support Ticket Number:
     
  11. Stefaans

    Stefaans Well-Known Member

    Joined:
    Mar 5, 2002
    Messages:
    451
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Vancouver, Canada
    Still no automatic DNS updates on slave server. Has anybody found a solution.

    FYI, the slave DNS server runs RedHat 8.0 and master server RedHat 7.3. We are currently experiencing numerous other Cpanel problems on RH8, e.g. client Cpanels not displaying and SSL certs cannot be added. Is RH8 a bad basis for Cpanel right now? :confused:

    cPanel.net Support Ticket Number:
     
  12. zex

    zex Well-Known Member

    Joined:
    Aug 12, 2001
    Messages:
    98
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    Did you try to delete ssh key's in .ssh dir ?

    cPanel.net Support Ticket Number:
     
  13. Dillard

    Dillard Well-Known Member

    Joined:
    Feb 26, 2003
    Messages:
    114
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    The Netherlands
    Yes, I tried this. Didn't work... One server (master) is RH80, slave is RH73, so perhaps this has something to do with it ??

    Only thing working right now, is a crontab with '/scripts/dnstransfer' :(

    cPanel.net Support Ticket Number:
     
  14. cyon

    cyon Well-Known Member
    PartnerNOC

    Joined:
    Jan 15, 2003
    Messages:
    320
    Likes Received:
    0
    Trophy Points:
    16
    * * * * * /scripts/dnstransfer >/dev/null 2>&1 works fine but we're still waiting for a fix!

    cPanel.net Support Ticket Number:
     
  15. Stefaans

    Stefaans Well-Known Member

    Joined:
    Mar 5, 2002
    Messages:
    451
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Vancouver, Canada
    Our auto sync is also still broken. Also keeping it updated with a cronjob.

    We manaeg to sort out all the other problems we had on our RH8 box (the slave), it's only this one issue that remains.

    cPanel.net Support Ticket Number:
     
  16. porcupine

    porcupine Well-Known Member
    PartnerNOC

    Joined:
    Apr 18, 2002
    Messages:
    74
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Toronto, Ontario
    cPanel Access Level:
    DataCenter Provider
    Might try running /etc/rc.d/init.d/named status and seeing if you get the correct output. We had this problem across 4 of our servers sharing DNS, it had turned out that something had mucked up the sockets, and named on 3 of the boxes needed to be stopped, and started from scratch. The /etc/rc.d/init.d/named script returned some kind of socket error if i remember correctly, after this, it *sort of* worked properly again (still working out the bugs that caused).

    cPanel.net Support Ticket Number:
     
  17. Stefaans

    Stefaans Well-Known Member

    Joined:
    Mar 5, 2002
    Messages:
    451
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Vancouver, Canada
    Thanks for the suggestion, but it doesn't seem to be the cause of our problem.

    /etc/rc.d/init.d/named status returns the following:

    number of zones: 1508
    debug level: 0
    xfers running: 0
    xfers deferred: 0
    soa queries in progress: 0
    query logging is OFF
    server is up and running

    Still waiting for a solution....

    cPanel.net Support Ticket Number:
     
  18. Juanra

    Juanra Well-Known Member

    Joined:
    Sep 22, 2001
    Messages:
    777
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Spain
    Is there any time skew between both servers? BIND will refuse to sync the servers if the time difference is too big.

    cPanel.net Support Ticket Number:
     
  19. Stenny Chong

    Stenny Chong Well-Known Member

    Joined:
    Jun 12, 2002
    Messages:
    67
    Likes Received:
    0
    Trophy Points:
    6
    Currently, I setup a cronjob which remove all *.db in /var/named and run /scripts/dnstranfer follow by /etc/init.d/named restart, this work perfectly for me.

    cPanel.net Support Ticket Number:
     
  20. Stefaans

    Stefaans Well-Known Member

    Joined:
    Mar 5, 2002
    Messages:
    451
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    Vancouver, Canada
    No, we are running all our server on GMT.

    A cronjob is also doing it for us for the time being, but an automatic sync will realy be first class.

    cPanel.net Support Ticket Number:
     
Loading...

Share This Page