Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

This question already has an answer here:

My webhoster seems to have some troubles with DDOS attacks and routing overload. This makes my IP to be not available sometimes and I'd like to add a failover IP for the domain.

However, 2 A-Records means that it's similar to a load balancer which is NOT what i am looking for. I do not want the fallback machine to be accessed any time - except in case of real troubles or downtime of first choice IP.

Is there a out-of-the box solution that allows me such a failover ip?

If not, if it requires a DNS re-configuration: Is there a recommended script or similar that can be run on the secondary machine (of course, this is with a different hoster). This has to check whether the first choice ip is down and must overwrite the A-record, right? This requires my domain hoster to provide an API for the DNS settings...

share|improve this question

marked as duplicate by Tom O'Connor Aug 25 '13 at 21:19

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer 1

up vote 1 down vote accepted

Any DNS provider that supports Dynamic DNS can assist with this requirement.

Let's assume you use DynDns and get a dynamic DNS name of uptime.homeunix.comNote 1. Assume your DynDns username is foobarme, and your password is "LeTmeiN"

  • Assume the address of your primary webhost is 192.0.2.100
  • Assume the address of your backup webhost is 192.0.2.200
  • Assume your web service's address is http://solid.rock.local/

Use ipcheck.py to assign your primary address to uptime.homeunix.com (I'm using linux)...

$ python ipcheck.py -a 192.0.2.100 foobarme LeTmeiN uptime.homeunix.com

Now CNAME solid.rock.local to uptime.homeunix.com.

If you need to use the backup webhost, it's this easy...

$ python ipcheck.py -a 192.0.2.200 foobarme LeTmeiN uptime.homeunix.com

The DNS TTL on these DynDns DDNS records is typically one-minute... pretty low.


Note 1: BTW, uptime.homeunix.com is available right now if you like it :-)

share|improve this answer
    
thanks, can this script also do the reliable check for current ip being down for me? so it's only overwriting the DNS in case of issues with the prefered server. –  ledy Aug 2 '12 at 10:11
    
This script will only assign ip addresses to the DDNS entry... the criteria for changing between your primary and backup webhost is outside it's capabilities –  Mike Pennington Aug 2 '12 at 14:50

Not the answer you're looking for? Browse other questions tagged or ask your own question.