I have two servers with same service, so

server 1 xxx.myhost.com   A record ip
server 2 xx2.myhost.com   CNAME record to otherhost.com

The server number 1 is the principal, so, I gave to my clients this host (xxx.myhost.com) to get access. Server 2 is a supporting server, in case #1 is not working.

I want to know: supposing server 1 went down for any reason, how should I configure bind to redirect to server 2?

so graphically my client call xxx.myhost.com ----it's down--- so bind automatically redirect to----xx2.myhost.com.

And of course my clients don't know about server 2 and they don't need to know it...

It's like MX servers ...only with A and CNAME records....

Sorry for my bad English.


What you're looking for is failover. This has actually been covered more technically over on ServerFault. But the tl;dr version is that Bind has no native facility for this.

You could use DDNS and zone updates to achieve this, but that would require quite a bit of additional configuration.

I guess you could also set up a custom script to monitor the server and push a zone update when it goes down. But again, quite a bit of custom configuration there. And it would be subject to the same problems mentioned in the first link - namely DNS caching.

As Rex said in the first link, some DNS providers, such as Route53 (which I have personal experience with) have integrated failover capability. This is probably the most 'sane' implementation.

A more exotic option is to set up the DNS to point to a 'gateway' server, which has static routes pointing to the 'preferred' server. A daemon of some type can check if the server is alive and change the routes as needed. This wouldn't have DNS latency, but - again - this is a pretty custom setup.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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