djbdns
[Top] [All Lists]

Re: "A" record priority?

To: "David B. John" <djohn@archdiocese-no.org>
Subject: Re: "A" record priority?
From: Michael Shuler <mshuler@rackspace.com>
Date: Fri, 01 Dec 2006 13:41:44 -0600
Cc: dns@list.cr.yp.to
Delivered-to: sp-com-lists@consult.net
Delivered-to: gmail-djbdns@securepoint.com
Delivered-to: sp.com.list@gmail.com
Delivered-to: mailing list dns@list.cr.yp.to
In-reply-to: <00c001c71571$86ec0150$16fe010a@archno.local>
Mailing-list: contact dns-help@list.cr.yp.to; run by ezmlm
References: <00c001c71571$86ec0150$16fe010a@archno.local>
User-agent: Thunderbird 1.5.0.8 (X11/20061115)
David B. John wrote:
> Is there a way to give “A” records a priority like I do with “MX” records?

You cannot give an A record priority.

> I have two rsync’d web servers in two different geographic locations. 
> I’d prefer to send traffic to location A until a disaster then failover
> to location B (automatically).  My name servers are also in two
> different geographic locations.

You could set up a cron job to test your loc. A site, and if it fails,
replace and rebuild your dns data with the loc. B IP address.  An example:

mshuler@kokopelli:~/tmp$ sh geofail.sh
<snip>
  0
good - no dns change
mshuler@kokopelli:~/tmp$ sudo /etc/init.d/apache2 stop
 * Stopping apache 2.0 web server...
                                                               [ ok ]
mshuler@kokopelli:~/tmp$ sh geofail.sh

curl: (7) couldn't connect to host
bad - rebuild your data here
mshuler@kokopelli:~/tmp$ cat geofail.sh
#!/bin/sh
# grab a url - if exit code !=0, then replace dns data
curl -O http://localhost/1x1_trans.gif; retval=$?
if [ $retval -eq 0 ]; then
 echo "good - no dns change"
else
 echo "bad - rebuild your data here"
fi

> I saw how I can do time to live, time to die, etc.
> http://cr.yp.to/djbdns/tinydns-data.html; however, I don’t see how that
> can help me do what I’m trying to do.

Date-based TTL records are primarily for IP migration, however a low TTL
(maybe 5 minutes) will definitely help your failover to happen rather
quickly, as the internet caches will not hold your failed A record for long.

Other options might be snmp traps on site response to rebuild your data,
 or actually using something like ospf to do real geographic load
balancing for a pool of servers, instead of some just sitting idle.

Kind Regards,
Michael

<Prev in Thread] Current Thread [Next in Thread>