Community Forums
Connect with us on LinkedIn
Community Notice
+ Reply to Thread
Results 1 to 8 of 8
  1. #1
    Member
    Join Date
    Feb 2008
    Posts
    20

    Question DNS Failover

    Dear all,

    is there any API or script to make DNS failover working upon WHM?

    Eg. I have domain abc.com which using Cpanel DNS only for DNS. I have 2 server with same content as www.abc.com (currently I add manual www.abc.com and www1.abc.com).

    Now, how do I create simple script (combine ping and wget for small txt from other server and compare it). If www is down, then I asked Cpanel DNS to update or create A record for www same with www1, so user does not need type www1.abc.com manually.

    Sorry for my english, and thank you.

  2. #2
    Technical Product Specialist cPanelDavidG's Avatar
    Join Date
    Nov 2006
    Location
    Houston, TX
    Posts
    10,718
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    In cPanel 11.25, we will be introducing an Edit DNS XML-API function. However, I have no ETA on 11.25.

  3. #3
    Member
    Join Date
    Feb 2008
    Posts
    20

    Default

    Thank you for your response,

    but we can not wait, so is there any solution for temporary? or little script?

  4. #4
    BANNED
    Join Date
    Jun 2005
    Location
    Wild Wild West
    Posts
    2,025

    Exclamation

    Why not just use rollover DNS resolution and mirror the accounts?

    I would presume you already have the mirroring portion setup if you
    already have the same content setup on both servers. In that case,
    all you would need to do is have (2) TWO entries in the DNS 'A' records
    for the same web address and you'll already have most of what you ask.

    In example ...
    Code:
    www IN A 127.0.0.1
    www IN A 127.0.0.2
    (Surprisingly most people don't know that you can actually do that)

    IE: instead of "www" on one server and "www1" and the other,
    you instead make both servers "www" and update the DNS zone
    files to have both IP addresses with (2) separate "A" records with
    the same "www" host identifier.

    Upon DNS resolution, BIND will normally rollover between the two
    IP addresses at each query and basically but not exactly load balance
    all you incoming connections between the two servers.

    If one server is down, the DNS resolution will fail but having both entries
    delivered will trigger most hosts to try the alternate IP for connectivity.

    The one thing that would be important though is that the DNS is not
    handled solely by the downed server. I would instead cluster your DNS
    between the servers and set both servers as authoritative servers for
    the domain name in question.

    You can also update the ZONE templates in Cpanel if you want to have
    the secondary IP address automatically added at account creation time.

    If you need to access a specific server, you can either create an alias
    address such as "www1" or "www2" or just add the IP of the server you
    need to connect to the "hosts" file on your own local computer.

    Hope that helps
    Last edited by Spiral; 06-13-2009 at 03:30 AM.

  5. #5
    Member
    Join Date
    Feb 2008
    Posts
    20

    Default

    Hello Spiral,

    I already setup "failover" like your suggestion, create www and www1 with different IP/location. But what I want to do is:

    If www (as main webserver) down then I execute some scripts on main DNS server to change IP of www to IP of www1 and spread to slave DNS.

    Thank you.

  6. #6
    Member damianz's Avatar
    Join Date
    May 2009
    Location
    United Kingdom
    Posts
    10

    Default

    Quote Originally Posted by muliahosting View Post
    Hello Spiral,

    I already setup "failover" like your suggestion, create www and www1 with different IP/location. But what I want to do is:

    If www (as main webserver) down then I execute some scripts on main DNS server to change IP of www to IP of www1 and spread to slave DNS.

    Thank you.
    A round robin effect as described by Spiral would be much more effective. Due to such factors as DNS propogation etc even if the DNS switched straight away the would be hours of downtime for DNS propogration to the new IP then if you switch it back you would have to wait for it to propogate again. The easiest way is to do what Spiral said which would just cause all requests to go to the live server but it would cause the requests to go to both servers not just the main one and the second one. If you wanted to specificaly use one main server and one standby then your looking at costly load balancing/network stuff Id guess.

    Also why www and www1 :S

    I mean if you really wanted to do it you would have to edit the raw DNS file then reload BIND but I dont think there is an API call to push the config accross a cluster. So in effect till there is an API function to do it it would be quite tricky.
    Last edited by damianz; 06-17-2009 at 01:14 PM.

  7. #7
    Member
    Join Date
    Apr 2006
    Posts
    25

    Default

    I would suggest DNS Made Easy it's free and they handle it all. no need for a script or anything. set a 3 min TTL... If server "A" is down it updates ip to server "B". as soon as "A" is back online it changes over to "A" again. It checks the server status every 30-60 seconds i believe. It also allows you input a a file to run on your server and a string to grab.

    I'm attaching a screenie of there demo fail over page...
    Attached Thumbnails Attached Thumbnails DNS Failover-failover.jpg  

  8. #8
    Member
    Join Date
    Feb 2008
    Posts
    20

    Default

    Dear all,

    finally I use webmin system status to do this task

    and it is work perfect.

    Thank you

Similar Threads & Tags
Similar threads

  1. cPanel DNS Only Failover
    By taenkarth in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 09-22-2009, 01:09 AM
  2. Failover
    By Grep_ler in forum Data Protection
    Replies: 14
    Last Post: 02-01-2007, 08:51 AM
  3. DNS Cluster/ Failover...
    By Rivaman in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 09-15-2006, 01:24 PM
  4. FailOver
    By youp in forum cPanel and WHM Discussions
    Replies: 10
    Last Post: 11-20-2005, 02:31 PM
  5. DNS failover / redundancy
    By cz1179 in forum cPanel and WHM Discussions
    Replies: 11
    Last Post: 02-05-2005, 10:25 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube