Suppose you have 50 identical www.heaven.af.mil web servers running on IP addresses 188.8.131.52, 184.108.40.206, and so on. You can simply list all their addresses in /service/tinydns/root/data:
+www.heaven.af.mil:220.127.116.11 +www.heaven.af.mil:18.104.22.168 +www.heaven.af.mil:22.214.171.124 # etc.When a DNS cache asks for the IP address of www.heaven.af.mil, tinydns will automatically return a random set of 8 addresses.
If one of your web servers crashes, the effect on users will depend on how their browsers behave:
You can eliminate delays by removing IP addresses of web servers that have crashed. tinydns is designed to work with external programs that monitor the health of your servers. Specify each address with a 5-second TTL:
+www.heaven.af.mil:126.96.36.199:5 +www.heaven.af.mil:188.8.131.52:5 +www.heaven.af.mil:184.108.40.206:5An external program can remove an address by simply changing + to - on the relevant line, then running make. Later, when that server has recovered, the program can change - back to +.