R
R
Ruslan2011-03-16 16:42:51
Domain Name System
Ruslan, 2011-03-16 16:42:51

Multiple IPs in DNS (A-record)?

I heard that you can distribute the load by issuing one or another IP. But I'm interested in what will happen if DNS issues two or more IPs at once. How do browsers (or OS) / search engines behave, as they should, is it provided for in any specifications? Can this create problems for the site (same search engines)?

Answer the question

In order to leave comments, you need to log in

6 answer(s)
S
Sergey, 2011-03-16
@bondbig

This is called DNS Round-Robin
By default, ip-addresses will be issued in a carousel order, you can configure random order or strict order.

P
pentarh, 2011-03-16
@pentarh

When resolving DNS in sish functions, not 1 ip is issued, but an array of ip, which often contains 1 element.
The DNS specification allows the definition of multiple IPs per 1 domain name. Yes, it's called DNS roulette.
I have not seen any recommendations in the RFC on how a client that has received several IPs should behave, so the software behaves very arbitrarily.
Often, for reasons of laziness, only the first IP address from the array is taken, and the rest are discarded. More advanced software takes IP one by one until it can reach the desired service on it. But there are few of them.
Therefore, how the software will behave depends on the order in which the DNS server issues IP addresses.
As far as I know, Bind returns in the order in which they are written in the config.
tinydns does a normal round-robin.
From my experience with DNS roulette, I can say that the appropriate DNS server for this is tinydns. And browsers stupidly take the first one in the list, because if Apache crashes on one IP, then the corresponding part of the traffic is lost.

S
shurshur, 2011-03-16
@shurshur

The final consumer of DNS (in fact, the user of the subsystem of resolving the names of your OS) receives exactly one random IP from this list, in the general case it is always different, it can change when you go to the next page, and even when downloading the necessary files (css, scripts, pictures) within the current page. In general, you cannot rely on the use of only one server by the client.
Search engines don't care, they only use the domain name to identify sites.

N
netnikogo, 2011-03-16
@netnikogo

bind issues randomly
unbound always in the same order as received
clients take the first ip from the received list

D
dovlados, 2014-04-10
@dovlados

If nslookup returns 2 or more server IP addresses for the same domain, then the site is running on each server. The browser tries to connect first with the first IP, then after a short delay with the next IP, and so on.
This can be used to fight a DDoS attack
, for example, nslookup on google.com gives:

Addresses: 2a00: 1450: 4010: C03 :: 65
173.194.32.162
173.194.32.169
173.194.32.168
173.194.32.166
173.194.32.164
173.194.32.165
173.194.32.167
173.194.32.161
173.194.32.161
173.194.32.163
total 12 servers

M
macik, 2020-10-15
@macik

Good day.
Well, if some of the IP is not available. How will the client behave in this case?
I have two IPs on one name, two different channels, everything is tied to one mail server.
I see that different networks take different IPs, mainly tied to the proximity of the route. But what happens if there is no access to one IP?!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question