Product

Product Features How to Compare Docs Screenshots Why

Start here

Getting started Download Guides Frequently asked questions

More

Security Support Roadmap About

DNS failover

11 answers

Handing out the address of a node that is actually up.

Looking for something specific

The searchable index covers all 326 answers at once and filters as you type.

262 Set up DNS failover from scratch
  1. Delegate a piece of your domain, such as gslb.example.com. Never the whole domain.
  2. DNS Failover, Add a zone. Give one nameserver name per node, such as ns1.example.com and ns2.example.com. You are inventing these now.
  3. Add a name, such as www, type A, TTL 30.
  4. Add one answer per node. Pick the node and its address fills in.
  5. Create the records the page prints at your domain host.
  6. Point the name people actually use at it with a CNAME.
dns failoverGSLBdelegatezonemulti site
263 Create the delegation records at my domain host

Two kinds and you need both. The page prints them with your addresses already filled in.

RecordWhat it does
NSSays who answers for this part of your domain. One per node.
A, called glueGives the address of each nameserver. Needed because a nameserver named inside the zone it answers for cannot be looked up without it, which is a loop.

The glue records are the ones people forget, and forgetting them looks exactly like the feature being broken.

NS recordgluedelegationdomain host
264 Set up DNS failover in Amazon Route 53

Open the hosted zone for example.com, which is the parent of the part you are delegating. Create these records there, not in a new hosted zone.

NameTypeValueTTL
gslbNSns1.example.com. and ns2.example.com.300
ns1A203.0.113.10300
ns2A203.0.113.11300
shopCNAMEwww.gslb.example.com.60

Do not create a hosted zone in Route 53 for gslb.example.com. Your nodes are the nameservers for it now, and a hosted zone as well gives two different sets of servers claiming the same name.

route 53awshosted zonedelegation
265 Test that DNS failover works

Ask each node directly, with no port on the end.

dig @203.0.113.10 www.gslb.example.com +short
dig @203.0.113.11 www.gslb.example.com +short

Both should answer and both should list every healthy node. Then ask the internet rather than the nodes, which tests the whole path:

dig shop.example.com +short
digtestverifyresolve
266 A name in DNS failover does not resolve

In this order, because the first two are where nearly all of these end.

  1. Ask the node directly with no port on the end. If that answers, the software is working and the problem is the delegation.
  2. Check the records at your domain host against the ones printed on the zone. The glue records are the ones people miss.
  3. Look at the DNS listener panel on each node. It reports what that node is really doing, which is not always what the page shows.
  4. Remember a name only starts working once the old answer has been forgotten everywhere, which can take longer than the TTL suggests.
not resolvingNXDOMAINtroubleshootingdelegation
267 Why does testing on the high port give the wrong answer?

The part that answers DNS runs without root on purpose, and a program without root cannot bind port 53. So it listens on 5353 instead, on UDP and TCP both, and a firewall rule the software manages sends UDP and TCP port 53 to it.

If you test against 5353 you get an answer whether or not the public path works. Always test with no port on the end, because that is the path your visitors use.

port 5353port 53testingfirewall rule
268 Choose a TTL

Thirty seconds is a sensible low number and is what the software suggests. Going much lower mostly buys extra lookups without moving anybody faster, because resolvers and browsers have their own ideas and some ignore very short values entirely.

TTLtime to livehow lowcaching
269 Take one node out of the DNS answer

DNS Failover, edit the name, and turn off the answer for that node. Save. Wait at least twice the TTL before doing anything else, because that is the time for computers elsewhere to forget the old answer.

Skipping that wait is the difference between nobody noticing and a few people getting errors.

remove from dnsmaintenancedrainwait
270 What should happen when every node is down?

Set If every node is down to hand them out anyway. If the health check itself is what broke, an empty answer takes the site down when it did not have to be.

all downempty answerfail opensafety
271 Can I use DNS failover for the apex of my domain?

The name at the very top of a domain cannot be a CNAME, so an apex needs addresses rather than an alias. Either delegate the apex, which moves everything including your mail records onto these nodes, or use your provider's own failover feature for that one name.

apexroot domainCNAMEnaked domain
272 How fast is DNS failover really?
What happenedHow long
Dead node removed from the answerAbout 30 seconds
Node restored, back in the answerAbout 5 seconds
A visitor whose computer had already askedUp to the TTL on top, so about a minute

Removal is deliberately slower than restoring, so a brief hiccup does not move everybody.

how fasttimingmeasuredseconds

Two fresh servers is all it takes

Ubuntu 22.04 or newer, root access, and about twenty minutes. The installer does the rest and it is safe to run twice.