1

I have a couple of DNS records with 2 or more IP addresses, for example, the A records for our email server is "mail.example.com" and have 2 IPaddress:

mail.example.com  1.2.3.4
mail.example.com  2.3.4.5

Each IP address belong to a different ISP. Sometimes, when one of those IP's are unavailable, some applications on users's computers (like Outlook) get stocked with only the first IP address on the A record they received from the DNS Server, even though it receives 2 IP's, Outlook does not try with the other IP. I've seen this with other applications as well. When I run "ipconfig /displaydns" I see that the DNS have delivered the 2 IP's for the A record, but the app is only using the first one.

We use Amazon Route 53 to manage DNS, and to workaround this I'm using "Health Checks" and then the DNS response based on the availavility of the IP's.

My question is, is it normal that applications use only the first IP address they find on the DNS record? Is there any other way to make the applications alternate between the IPs on a given DNS record or this behave depends on the app?

3
  • For mail systems, you should use two MX records instead of two A records. That will make all standards-compliant mailservers try the second server if the first is down.
    – Jenny D
    Aug 20, 2017 at 9:21
  • Hi, and thanks for your reply, but the MX records are used by SMTP servers, I'm refering to clients like Outlook, they look for A record, not MX. Aug 20, 2017 at 18:17
  • Ah, that was a misunderstanding on my part. In that case, you've already been answered below.
    – Jenny D
    Aug 20, 2017 at 18:33

2 Answers 2

6

My question is, is it normal that applications use only the first IP address they find on the DNS record?

Yes. Many applications are designed in a way to return a single address when resolving a hostname to numerical address. Some applications such as web browsers will pull a full list of records and try them sequentially on failure.

Is there any other way to make the applications alternate between the IPs on a given DNS record or this behave depends on the app?

No, this needs to be handled by the name server. Even with round robin, there are cases when the first IP Address returned by the resolver is not the first returned to the application from the method used for the lookup.

2
  • 1
    I believe the AWS DNS Server, Route 53, returns records in a random order. That way if the clients use the first record in the list they're effectively using a random record.
    – Tim
    Aug 18, 2017 at 2:31
  • Agreed. Multiple A records should be treated with the same priority. The order of multiple records cannot be a reliable way to determine weight of a specific record, nor be used for health or geolocation checks, that logic should stay within the resolver. Aug 18, 2017 at 2:37
2

Of course, the purpose of DNS is to get an IP address. The only reason that would make me as an app developer to use a second A or AAAA record would be if I couldn't connect to the endpoint with the first one.

If you wanted to do load balancing you would have to take that "ordinary" behaviour into consideration and make your DNS server prioritize A or AAAA records accordingly.

2
  • That doesn't really answer the question.
    – Tim
    Aug 17, 2017 at 22:08
  • I beg to differ. The implication is clear: it is app dependent. Aug 17, 2017 at 22:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.