Skip to main content Skip to search
Carl Levine
Posted by
Carl Levine on
October 6, 2016

How Many IPs Is Too Many?

The DNS was developed to do a very basic task in the beginning - put a human-readable name in front of an IP address. As the notion of today’s Internet became a more pervasive thing, early attempts at redundancy resulted in some interesting experiments by curious technologists.

Is There A Limit On How Many IP Addresses Can Be Put Behind A Hostname?

Theoretically, no. The DNS itself will return answers that are behind a given hostname, however logical limits in nameserver software might interfere with this.

Size, for instance, is a factor when looking at multiple answers returned on a single lookup. Figure a typical DNS response with a single IPv4 address is somewhere around 40-60 bytes. As addresses are added to that response, the size incrementally bumps up. Around 32 addresses, a UDP transaction then has to be run as TCP as it has exceeded the roughly 464 byte limit that flips the TC bit. This introduces a bit more latency into a transaction, which ultimately impacts a user’s experience.

This begs the question, however; would you ever want to have 1000 responses behind a single hostname? Probably not. Even a handful of addresses being returned for a single query can introduce a lot of interesting implications. Most nameserver software, eg. BIND, accomplishes this by utilizing a “round robin” method of answer selection to randomly select an answer.

What’s Round Robin?

This is perhaps the most basic way to present a number of addresses behind a single host address. Obviously, there can only be one definitive answer that the resolver chooses and holds in memory for the duration of the Time To Live (TTL) value. However, if there is more than one available address returned in the response, one is chosen at random.

Example: Google uses a round robin lookup at their zone apex.

; <<>> DiG 9.8.3-P1 <<>> google.com a
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 46860
;; flags: qr rd ra; QUERY: 1, ANSWER: 6, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;google.com.            IN    A
;; ANSWER SECTION:
google.com.        23    IN    A    209.85.144.139
google.com.        23    IN    A    209.85.144.113
google.com.        23    IN    A    209.85.144.100
google.com.        23    IN    A    209.85.144.102
google.com.        23    IN    A    209.85.144.101
google.com.        23    IN    A    209.85.144.138
;; Query time: 26 msec
;; SERVER: 50.207.245.2#53(50.207.245.2)
;; WHEN: Wed Oct  5 10:57:56 2016
;; MSG SIZE  rcvd: 124

While the basic advantage of having a bunch of addresses available to choose from ensures redundancy, this method is tempered with the unpredictability that is intrinsic to this sort of behavior. The logic to monitor and administer entries in the DNS incumbent on the network operator, whereas using a Managed DNS provider will likely put more control and monitoring opportunities in your hands.

NS1 is pleased to offer solutions to help enhance your load balancing strategies. Leveraging intelligent routing with NS1’s Filter Chain will allow you to take the information that is important to you, your business, and most importantly your users and customers to make smarter DNS steering decisions.