#1 (permalink)  
Old 06-08-2009, 01:40 AM
Registered User
 
Join Date: Feb 2008
Posts: 18
muliahosting is on a distinguished road
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 06-09-2009, 09:56 AM
cPanelDavidG's Avatar
cPanel Technical Sales
 
Join Date: Nov 2006
Location: Houston, TX
Posts: 8,117
cPanelDavidG is on a distinguished road
In cPanel 11.25, we will be introducing an Edit DNS XML-API function. However, I have no ETA on 11.25.
__________________
Need technical assistance? You can find your best avenue for support at: http://support.cPanel.net
-- cPanel David G., Lead Forum Administrator & cPanel Technical Sales Representative
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 06-12-2009, 06:31 PM
Registered User
 
Join Date: Feb 2008
Posts: 18
muliahosting is on a distinguished road
Thank you for your response,

but we can not wait, so is there any solution for temporary? or little script?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 06-13-2009, 02:23 AM
Senior Member
 
Join Date: Jun 2005
Location: Area 51
Posts: 1,621
Spiral is on a distinguished road
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 02:30 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 06-14-2009, 10:11 PM
Registered User
 
Join Date: Feb 2008
Posts: 18
muliahosting is on a distinguished road
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 06-17-2009, 12:12 PM
damianz's Avatar
Registered User
 
Join Date: May 2009
Location: United Kingdom
Posts: 10
damianz is on a distinguished road
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.
__________________
-Damian
Excellent free hosting | Paid Hosting

Last edited by damianz; 06-17-2009 at 12:14 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 06-22-2009, 12:59 PM
Registered User
 
Join Date: Apr 2006
Posts: 23
fineline is on a distinguished road
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 Images
File Type: jpg failover.jpg (196.9 KB, 17 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 06-25-2009, 02:13 AM
Registered User
 
Join Date: Feb 2008
Posts: 18
muliahosting is on a distinguished road
Dear all,

finally I use webmin system status to do this task

and it is work perfect.

Thank you
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Failover on CPANEL anasnajj cPanel Newbies 1 04-23-2009 08:52 AM
Failover Grep_ler cPanel Newbies 14 02-01-2007 07:51 AM
DNS Cluster/ Failover... Rivaman cPanel and WHM Discussions 1 09-15-2006 12:24 PM
FailOver youp cPanel and WHM Discussions 10 11-20-2005 01:31 PM
DNS failover / redundancy cz1179 cPanel and WHM Discussions 11 02-05-2005 09:25 AM


All times are GMT -5. The time now is 09:01 PM.


Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
© cPanel Inc