Use DNS to achieve Load Balancing

Source: Internet
Author: User
Tags website domain names

As the number of users accessing CEN servers increases dramatically, it is difficult for a single server to meet users' access needs. How can we ensure normal user access? There are many solutions, such as using Windows2000 or WindowsServer2003 to provide the network load balancing service, but the settings of this service are very complicated. However, implementing network load balancing through DNS is a simple method.
 
Taking Web servers in the enterprise network as an example, I will introduce how to use DNS servers to achieve network load balancing. To increase the access volume of the website with the domain name "www.xxx.net", three Web servers with the same content are deployed in the enterprise network to provide the same service, but the IP addresses of each server are different. Next, set up the DNS server in the enterprise network to enable the three Web servers to jointly undertake the customer's access to the website.
 
1. Enable Loop
 
Take Windows server as an example. On the DNS server, choose Start> program> Administrative Tools> DNS to go To the DNS manager window. Right-click the DNS Server icon, in the pop-up shortcut menu, select the "properties" option and switch to the "advanced" tab (figure 1) in the "properties" dialog box ), make sure that the "enable loop" option in the "server options" list box is selected.
 
Ii. Add host records
 
Create a host record in the "xxx.net" area. In the DNS manager window, right-click "xxx.net" and select "New Host" in the pop-up menu to enter the "Create host" dialog box, and enter "WWW" in the "name" column ", enter the IP address of one of the Web servers in the IP address bar, for example, 192.168.0.5. Then, click "add host.
 
Because there are three Web servers in the enterprise network and their IP addresses are different, we also need to create two host records with the Host Name "WWW" in the same way as above, except that their IP address content is different. In this way, the website domain names can be resolved to different Web servers.
 
The following table lists the three host records in the xxx.net region of the DNS server:
 
After the above three host records are created (Figure 2), the Web server's network load balancing is realized. In this way, when the client accesses the www.xxx.net website, it will send a domain name resolution request to the DNS server. When the DNS server receives the first request, it will return the first IP address 192.168.0.5 to the client. When the second client requires domain name resolution, the DNS server will return the second IP address 192.168.1.5 to the client. Through such cyclic allocation, client access can be shared to different Web servers to achieve network load balancing.
 
Iii. Optimization of Server Load balancer Functions
 
A cen usually consists of many subnets. To reduce the data traffic in the network, it is best for a client to access a Web server in the same subnet. Although the network load balancing function is implemented, it is not guaranteed that the customer accesses the subnetwork's Web server. In fact, this problem is well solved, as long as you enable the "enable network mask sorting" function of the DNS server.
 
In the DNS manager window, right-click the DNS server, select "properties" from the pop-up menu, and switch to the "advanced" tab in the Properties dialog box, select the enable network mask sorting option in the "server options" list box. In this way, the client can access the Web server in the subscriber network every time.
 
After the above settings are completed, the DNS server implements the network load balancing function, shares the customer's access to each Web server, and reduces the network communication traffic across subnets, greatly reducing the communication burden of Enterprise Networks

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.