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
|