How to Use DNS to Map One Domain to Multiple IPs for Load Balancing
This guide explains how a single domain can be configured with multiple A records to point to different IP addresses, describes common DNS resolution strategies such as round‑robin and weighted routing, and outlines the advantages and limitations of DNS‑based load balancing.
One Domain to Multiple IPs
In theory a domain name can resolve to several IP addresses, allowing different users to reach different servers when they query the same domain.
To achieve this, add multiple A records for the domain on your DNS provider. For example, to map www.itmtx.cn to three IPs—1.1.1.1 (Beijing Telecom), 2.2.2.2 (Shanghai Mobile), and 3.3.3.3 (Shenzhen Unicom)—create three A records:
www.itmtx.cn IN A 114.100.20.201;
www.itmtx.cn IN A 114.100.20.202;
www.itmtx.cn IN A 114.100.20.203;
When a Beijing user accesses itmtx.cn and a Shanghai user does the same, each receives a different IP based on the pre‑configured DNS resolution policy, effectively forming a server cluster and providing load‑balancing benefits such as reduced latency and higher availability.
DNS Resolution Strategies
Common DNS routing policies include:
Round Robin : Returns IP addresses in sequence to distribute requests evenly.
Weighted : Assigns a weight to each IP; higher‑weight servers are selected more often.
Response Time : Chooses the IP of the server with the fastest measured response time.
Different DNS providers implement various combinations; for example, DNSPod uses a weighted‑plus‑random strategy.
Pros and Cons of DNS‑Based Load Balancing
Advantages:
Offloads load‑balancing to DNS, eliminating the need for dedicated load‑balancer hardware or software.
Simple, flexible, low‑cost implementation suitable for most TCP/IP applications.
No code changes required on the servers to benefit from distributed access.
Many DNS systems support geo‑location routing, directing users to the nearest server.
Disadvantages:
DNS caching at multiple levels (recursive resolvers, TLD servers, authoritative servers) can delay propagation of IP changes, causing temporary access failures.
Short TTLs to mitigate caching lead to frequent DNS queries, increasing network overhead.
DNS cannot actively monitor server load or dynamically adjust weights, so it lacks real‑time load awareness; large sites often combine DNS routing with higher‑level load balancers for finer control.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Liangxu Linux
Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
