Win2003 use DNS server to implement load Balancing _dns server

Source: Internet
Author: User
Tags web services
There are many solutions, such as using Windows2000 or WindowsServer2003 to provide Network Load balancing services, but the settings for this service are complex. And it is a simple method to realize Network Load Balancing through DNS server.

The author takes the Web server in the enterprise network as an example to introduce how to use the DNS server to achieve Network Load balancing. In order to increase the amount of access to a Web site with a domain name of "www.jb51.net", three Web servers with the same content are deployed in the enterprise network, which provide the same service, but each server has a different IP address. The following sets the DNS servers in the enterprise network to enable the three Web servers to share customer access to the site.

First, enable the loop

Take the WindowsServer2003 system as an example, in the DNS server, click the "start → program → Administrative tools →dns" option, enter the DNS Manager window, right-click the DNS server icon, in the pop-up shortcut menu, select the "Properties" option, Then switch to the Advanced tab in the Properties dialog box (Figure 1) to make sure that the Enable looping option is selected in the Server Options list box.

Second, add host records

Create a host record in the Jb51.net area. In the DNS Manager window, right-click the "Jb51.net" Item, select "New Host" in the pop-up menu, enter the new Host dialog box, enter "WWW" in the "Name" field, and enter the IP address of one of the Web servers in the IP address bar, such as 192.168.0.5, and finally click " Add Host button.

Because there are three Web servers in the corporate network and their IP addresses are different, there is also a new two host record with host name "WWW", just like the above, whose IP address is different. This will enable the site domain name to be resolved to separate Web servers.

DNS server jb51.net zone three host records are shown in the following table:

After the creation of the above three host records (Figure 2), the Network Load Balancing of the Web server is achieved. This will send a domain resolution request to the DNS server when the client accesses the Www.jb51.net Web site. When the DNS server receives the first request, it returns the first IP address 192.168.0.5 to the client, and when the second client requires a domain name resolution, the DNS server returns the second IP address 192.168.1.5 to the client. Through this kind of cyclic allocation, the client's access can be shared on different Web servers, thus the Network Load Balancing function is realized.

Iii. optimization of load balancing function

Enterprise networks are often made up of subnets, and in order to reduce data traffic in the network, it is best for clients to access Web servers that are in the same subnet. Although the Network Load Balancing function is realized, it does not guarantee that the client is accessing the Web server of the Notebook network. In fact, this problem is also very good to solve, as long as the DNS server to enable the "Enable Network mask sorting" feature.

In the DNS Manager window, right-click the DNS server, select Properties from the pop-up menu, and then switch to the Advanced tab in the Properties dialog box to check the "Enable netmask sorting" option in the Server Options list box. This allows the client to access the Web server in the notebook each time.

When the above settings are completed, the DNS server realizes the Network Load Balancing function, the client's access is shared on each Web server, and the network traffic across the subnet is reduced, which greatly reduces the communication burden of the enterprise network.

Full version:

Now the scale of the network is bigger and larger, the load of the server in the network is also getting heavier. For example, a Web server is installed on a company's network to provide services to users in the intranet, and if thousands of or even tens of thousands of users in the network need to access the Web server at the same time, the performance of this server will be extremely poor.

How to solve this problem? This problem can be addressed by providing a load banlance workload balancing Service in Windows Advanced Server, but the settings for this service are more complex. In addition, we can use DNS to achieve load balancing function.

enable round robin enables loops

To reduce the load on a particular server, we can install multiple servers in the network. For example, there is only one X235 Web server in the original network whose host name is Www.test.com,IP address 192.168.1.100. To reduce the load on this Web server, we can install multiple X235 on the network to provide Web services and ensure that the content of each Web server is consistent. If it is possible to allow clients to access different Web servers individually, this will achieve the purpose of sharing the load. So how do you get clients to visit different Web servers separately? This will use the round robin functionality provided by the DNS service.

We can do this by doing the following steps:

In Windows200, open the DNS Manager in Administrative Tools.

In DNS management, right-click the DNS server icon and select the property Properties menu in the pop-up menu.

In the pop-up window, select the Advanced tab. Make sure the Enable round robin option is in the selected state.

Click OK to close the window.

After you set up the round roubin, you need to add the host record in the DNS zone (Zone):

To open the DNS Manager in Administrative Tools

Right-click the area where you want to create the record, and select new host record in the pop-up menu. Then follow the wizard prompts to enter the necessary information.

Host name IP address
www 192.168.1.200
www 192.168.1.201
www 192.168.1.202

When you have entered the corresponding relationship between the host name and IP of all hosts, you will see a window similar to the one shown below.

Here we note that the three host records added are the same host name corresponding to the different IP. These different IP is the actual IP of multiple Web servers installed in the network, they correspond to the same hostname www.test.com.

This sends a name resolution request to the DNS server when the client enters in the browser's address bar: www.test.com to access the Web server. When a DNS server receives a request from the first client, the first IP 192.168.1.200 is responded to the client, and when the second client asks for resolution, the server responds to the client with the second IP192.168.1.201, and so on. By such a cyclic allocation of IP addresses, you can have different clients to access different servers, so as to share the load of the server function.

enable netmask ordering enabled subnet first

If your company's network is made up of multiple subnets, to enable users to access resources on the server more efficiently, such as resources on a Web server, we can install a Web server on each subnet that holds exactly the same data and uses the same hostname. For example: www.test.com. So how do you get users to enter the hostname www.test.com in their browser's address bar, accessing the Web server in the notebook, not the Web server on the other subnet? This functionality can be achieved by setting the Enable netmask ordering enabling subnet precedence.

To implement the Enable Netmask ordering enabled subnet First, we can follow these steps:

To open the DNS Manager in Administrative Tools

In DNS management, right-click the DNS server icon and select Properties menu from the pop-up menu. In the pop-up window, select the Advanced tab. Make sure the Enable Subnet ordering option is in the selected state. Click OK to close the window.

After you set up the subnet ordering, you need to add the host record in the zone:

To open the DNS Manager in Administrative Tools

Right-click the area where you want to create the record, and select new host record in the pop-up menu. Then follow the wizard prompts to enter the necessary information.

For example:

Host name IP address
www 192.168.1.200
www 202.96.1.201
www 64.35.1.202

When you have entered the corresponding relationship between the host name and IP of all hosts, you will see a window similar to the one shown below.

This allows us to add three host records to the DNS server: the same host name corresponds to a different IP. These different IPs are the actual IP addresses of the Web servers installed on different subnets, and they correspond to the same host name www.test.com.

This allows the client to issue a name resolution request to the DNS server when the user enters the address bar in its browser: www.test.com to access the Web server. When a client's query request is received as a DNS server, the client's IP address is compared to which of the IP addresses of the host name it is requesting is in the same subnet, and then the IP (the IP address on the same subnet as the client) is responded to the client. This allows the client to access always the Web server, the server's access load to the various subnets of the server, and reduce the network traffic across the subnet.

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.