Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

DNS polling configuration under WINDOWS and LINUX

2025-04-11 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces the knowledge of "DNS polling configuration under WINDOWS and LINUX". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

DNS polling means that the DNS server distributes domain name resolution requests to different IP one by one in the order of A records, and achieves simple load balancing to some extent.

Let's take a look at how to set up DNS polling under WINDOWS2003. For example, there are two WEB hosts, the A host ip is 192.168.1.1, and the B host ip is 192.168.1.4. There is a separate DNS server in the enterprise, and then two host A records are established in the forward area of the DNS server (domain name is haiquan.net). The first host record IP is 192.168.1.1, and the second host record IP is 192.168.1.4.

Then right-click on the DNS host QINGYG and select Properties, and check "enable Loop" in the dialog box that appears, as shown in the figure:

Note: WINDOWS caches DNS results. In order to observe polling, we need to use "ipconfig / flushdns" to clear the DNS cache.

Let's take a look at how to set DNS polling under LINUX, taking RHEL 5 as an example:

1. First, you need to install BIND and build a DNS server (for specific DNS building process, please refer to relevant materials)

# yum install-y bind* caching-nameserver*

Installing the DNS server generally requires the following three packages to be installed:

Bind-utils-9.3.3-7.el5 query for

Bind-chroot-9.3.3-7.el5 security mechanism

Caching-nameserver-9.3.3-7.el5 configuration file

2. Modify the zone data configuration file (example.com.db). Here is a look at the DNS polling configuration.

IN MX 10 mail.example.com.

......

Mail IN A 192.168.1.9

IN A 192.168.1.10

IN A 192.168.1.11

In the above configuration, mail.example.com corresponds to three IP addresses, and which A record is selected at this time is determined by the rrset-order statement. In addition, in the reverse parsing file, the three IP should also correspond to the mail host, so as to avoid problems when some mail servers do reverse queries for anti-spam.

This is an example of an options statement about rrset-order configuration in the / etc/named.conf file:

Rrset-order {

Class IN type A name "mail.example.com" >

Order cyclic

}

This setting causes the responses of the A records in the IN class to be returned in random order, with the IN class suffixed with "mail.example.com". Other records are returned as circular records.

Rrset-order supports three parameters: fixed, random, and cyclic.

Fixed gives multiple A records in the order of configuration files.

Random randomly gives

The cyclic loop gives

Note: the rrset-order statement is not supported by BIND9. BIND9 currently only supports "random-cyclic" sorting. The server randomly selects the starting point in the RRset set and sequentially returns the records starting at that point.

3. Test results:

[root@linux252:/] # host mail.example.com

Mail.example.com has address 192.168.1.9

Mail.example.com has address 192.168.1.10

Mail.example.com has address 192.168.1.11

To sum up:

The configuration of DNS polling is relatively convenient. If the network is expanded, the newly added Web server only needs to add a public network IP. But relatively speaking, DNS polling also has its own shortcomings, this work is also what we need to pay attention to.

One: if a server goes down, the DNS server is unknowable and will still assign access to this server. It usually takes 1-3 hours or even longer to modify DNS records to take effect.

Second: if the hardware configuration of several Web servers is different, the pressure that can be withstood is also different, but DNS polling resolution can not be well distributed according to weight.

Third: if it is a Web site that requires authentication, DNS parsing cannot persistently assign the access of authenticated users to the same server. Although there is a certain local DNS cache, it is difficult to ensure that the local DNS does not expire during user access, and re-query the server and point to the new server, then the user information saved by the original server can not be brought to the new server, and may be required to re-authenticate identity, and switching back and forth for a long time, each server keeps different user information, which is also a waste of server resources.

This is the end of "DNS polling configuration under WINDOWS and LINUX". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report