6

How are the secondary addresses used? Is it application specific?

Note: I'm not asking about round robin dns. That could be done by only returning 1 address at a time.

3
  • 3
    It could, but it's not. Typical implementation of round-robin DNS is to return all A records to a client request. Otherwise, you won't get much round-robin; you'd give a single-address response to a massive ISP's caching server, and all of their clients will hit only that address. More info here. Apr 29, 2011 at 16:52
  • Even though this is a comment, I find this the most useful reply. If it were an answer, I would select it as accepted
    – Aheho
    Apr 29, 2011 at 19:13
  • What are you really trying to ask here? You don't understand how RR-DNS works, so a discussion of what other objectives someone might be trying to achieve are probably pretty futile.
    – symcbean
    Apr 29, 2011 at 22:45

4 Answers 4

4

I believe that IS round robin DNS. The DNS server returns all the IPs for services matching that A record. It is up to the client/browser to resolve which IP to use.

1
  • 5
    The client should use them in the order provided, and most clients will only use the first one returned. The DNS Server will mix up the order to create the round robin effect.
    – Chris S
    Apr 29, 2011 at 16:51
3

If a client fails to connect to the first IP-address, it can try to connect to the next IP-address in the list if more than one IP address is provided. You can see it as a "cheap" fault tolerance solution. And the order of the addresses is altered (round robin) so it also works as a "cheap" load balancing.

2
  • You said that "if a client fails to connect...it can try to connect to the next IP address" But in practice do client application actually do this?
    – Aheho
    Apr 29, 2011 at 19:10
  • @Aheho: It's up to the client to decide. But all modern browsers does it, even Internet Explorer since Windows XP SP2. See What happens when a Front End goes down? Do we lose traffic?
    – Jonas
    Apr 29, 2011 at 19:32
1

For one thing, the DNS protocol is designed to be independent of the data that's actually stored in it. There are many record types that really need multiple answers, like MX (mail servers), and NS (name servers) records. Generally you should always have multiple of those if you're running a decent site with redundancy in place.

For addresses, however, there are times that people like returning multiple records. The DNS specifications state that if you get more than one, you should ideally "pick one at random". This is highly helpful for spreading load across multiple machines, though in practice it's not as ideal as you'd like which is why there is a more common practice of IP-based load balancers rather than using multiple answers. Thus, multiple-A or multiple-AAAA (IPv6) are less used than they used to be.

But remember: DNS, the protocol, is designed not to care about the data it is carrying. It will happily deliver multiple records of a particular type even if it is not useful to the end-application.

0

I know this is an old question, but I stumbled across it and thought I'd put in my 2 cents. Please, retort, as I enjoy hearing other's point of view.

Using Multiple DNS entries is a form of fault tolerance, but I wouldn't always consider it a 'cheap' form. It's only cheap, if that's your overall plan for High Availability (HA). If you want to build a highly available architecture you will also require other mechanisms, such as clustering across zones and regions. Once you start clustering your infrastructure you will inherently require some sort of load balancing appliance that sits in front of your cluster. In order to make your Load Balancers highly available, and prevent single point-of-failure (SPF) you will also need to cluster your load balancers. Herein lies the issue, and where multiple DNS records solves a very real problem. Once you cluster your load balancer there's no real way to make your system highly available without introducing another mechanism, away from pure TCP/IP and routing. This is where multiple DNS records solves the problem.

If you own a domain (www.example.com) and you are trying to make it highly available, and you end up at the point where you have clustered all your infrastructure across multiple regions and availability zones, and have taken the time to implement a load balancing cluster, you will want to point your domain to all the load balancing endpoints in your load balancer cluster. (i.e. return multiple DNS A Records)

This way, every time a client requests www.example.com, they will get 2 or more IP addresses in return. If the 1st one succeeds, it will be used, but if it doesn't, then the second IP address (or 3rd or 4th, etc. etc.) will be used instead. These initial IP address are the IP addresses of your Load Balancers. Which will then route your requests accordingly to the cluster.

3
  • That relies on sane behaviour from clients. Not a universally valid assumption.
    – womble
    Jun 29, 2016 at 6:13
  • Agreed! A better implementation would be Floating IP addresses that implement an Active/Passive setup, of which would require 1 of the following: 1.) Corosync and Pacemaker 2.) Keepalived 3.) Heartbeat Jun 29, 2016 at 6:51
  • I also think that something like keepalived is probably more relyiable. Notheless, it is an interesting point. I can see that this can even work out of the box if you used haproxy shared stick tables. So it doesn't matter which proxy is hit as they all share the same info.
    – The Fool
    Nov 27, 2020 at 10:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .