View function of DNS

Source: Internet
Author: User

In a large network, due to the complexity of the network and other reasons, when we access certain Internet resources, the speed will be very slow, and the providers of these resources, such as shopping websites, to increase the access speed of customers, they put multiple service servers in different networks, and we expect to access the server closest to us to achieve the fastest access speed, at this time, the DNS server resolution function will be directed to the corresponding fixed server in different networks. The implementation of this function requires the DNS view function, in this case, the DNS server performs the effect of network sharding.

The view function of DNS needs to be defined in the DNS service configuration file. In the view, you must first define the network segment of the user, use the ACL function to define the specific CIDR blocks of the corresponding CIDR blocks. Then, add these CIDR blocks in the view definition, and then add the corresponding regional data parsing file, the region data parsing file defines different resource server addresses, such as WWW, so that users of different network segments can access server resources distributed in different regions and locate them on different servers, then there are many defined zones.

Assume that we only have one DNS server in the large network with the DNS view function. This DNS server has other slave DNS servers responsible for the entire large network, therefore, the CIDR blocks on the DNS server must be defined multiple and allow recursive queries within the CIDR blocks. Each CIDR block must define the corresponding data parsing file, and the specific resource record IP addresses must be defined in the parsing file, in this way, the sub-network effect is achieved. Generally, there are multiple DNS servers in our network. These servers must be in a specific network, this means that it is limited by the corresponding network, so the network segment of its service must be the so-called Intranet network segment. When our client requests the DNS server to resolve, if the resources that the client wants to access are defined in this Intranet, the DNS server of this network segment will be fixed to this server, this means that in the DNS configuration file, the internal network of your service is usually defined separately from the external network, and other external networks are resolved by another DNS server in different regions, for users, the DNS servers they request are for these intranet customers Therefore, the view configuration of the DNS server is usually divided into Intranet users and Internet users. In the actual environment, the query of an Internet user request is also performed on the Intranet DNS server where it is located, instead of other DNS servers. Now we use a simulated method to verify the DNS view function, when the DNS server receives an intranet user query request, a fixed result of the returned resource record is returned, the user requests in the outer network segment return the IP addresses of resources in other network segments. (In the actual environment, requests from other outer network segments are sent to the server responsible for parsing the region, instead of being sent to this platform). To some extent, our view function is verified to achieve the effect of network sharding.

During configuration, we need to define the zone line of the root region in the main configuration file to the view.

Test environment: DNS server, IP: 172.16.103.1

Intranet CIDR Block: 172.16.0.0/16

Internet segment: 192.168.1.0/24

The following content is defined in the DNS server configuration file:

650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M01/44/B9/wKioL1PiWTCSoUzWAACIn83vPDI871.jpg "Title =" 2014-08-07 00_28_10-root @ stu04 _~ -Xshell 4.jpg" alt = "wkiol1piwtcsouzwaacin83vpdi871.jpg"/> 650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M01/44/B9/wKiom1PiWCTjivzLAAG81CTCeT0760.jpg "Title =" 2014-08-07 00_28_28-root @ stu04 _~ -Xshell 4.jpg" alt = "wkiom1piwctjivzlaag81ctcet0760.jpg"/>

Note that the definition of the root region should be placed in the view of the internal network segment. The definition of the external client region only defines to query the resource records of this domain, the definition of other regions is not defined because DNS servers in the region do not perform recursive queries.

Add the corresponding data parsing file for Intranet query. The content is:

650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M01/44/B9/wKiom1PiWYCgnEhkAACzK3tH34Y789.jpg "Title =" 00_35_28-root @ stu04 _ var_named-xshell 4.jpg" alt = "wkiom1piwycgnehkaaczk3th34y789.jpg"/>

Add the corresponding data parsing file for Internet query. The content is:

650) This. width = 650; "src =" http://s3.51cto.com/wyfs02/M01/44/B9/wKiom1PiWpriBYa0AAC2vLhyrL0327.jpg "Title =" 00_40_06-root @ stu04 _ var_named-xshell 4.jpg" alt = "wkiom1piwpribya0aac2vlhyrl0327.jpg"/>

Adjust the attribute of the two data parsing files to 640, And the array is named:

# Chgrp named/var/named/sueking.com.int

# Chgrp named/var/named/sueking.com. ext

# Chmod 640/var/named/sueking.com.int

# Chmod 640/var/named/sueking.com. ext

Use a host with the same network segment as the DNS server for testing:

# Dig-t a www.sueking.com @ 172.16.103.1


Test the host using another network segment. Assume that the Host IP address is 192.168.1.100:

# Dig-t a www.sueking.com @ 172.16.103.1


The returned result is the Host IP address of www.sueking.com defined in sueking.com. Ext.


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.