Application of bind9 advanced view in Linux

Source: Internet
Author: User
Tags nslookup command

In Linux, the application of the bind9 advanced view is well known that the access speed between China Netcom and China Telecom is very slow, however, a large network company like Sina, no matter where you access the network, the access speed is very fast. How can this problem be achieved! The first thing that comes to mind is that China Telecom and China Netcom have some servers with identical content. How can we allow telecom users to access their own servers, this requires the bind9 high view that we are talking about today. Www.2cto.com first open the Linux system and check whether the bind9 software package is installed. Run the following command: rpm-q bind and press Enter. If yes, we will see a prompt for bind-9.2.1-16; if the package bind is not installed, we need to find the bind9 installation package from the linux installation disc and install it. Run the following command: vi/etc/named. conf/Open the main configuration file of bind9 and find options {directory "/var/named";/** If there is a firewall between you and nameservers you want * to talk, you might need to uncomment the query-source * directive below. previous versions of BIND always asked * questions using port 53, but BIND 8.1 uses an unprivileged * port by default. * // query-source address * port 53;}; move the cursor to the braces below and press o to insert Enter a line and write the following statement: www.2cto.com acl "dianxin" {10.0.0.0/8; 11.0.0.0/8 ;};# declare the China Telecom IP address segment acl "wangtong" {255.0.0.0/8; 21.0.0.0/8 ;}; # declare the following IP address segments of China Netcom. The content is written in controls {inet 127.0.0.1 allow {localhost ;} keys {rndckey ;};}; view "dianxin" {match-clients {dianxin ;}; # declare that only telecom users are allowed to query recursion yes # Whether recursive query is allowed }; notify yes # whether to allow primary/secondary DNS to synchronize data zones ". "IN {type hint; file" named. ca ";};# automatically query 13 root zones" abc.com when DNS fails "IN {type master; # set as the primary DNS file" abc.com. dx. zone "# Set the record name of the abc.com domain name };}; view" wangtong "{match-clients {wangtong ;};# the statement only allows the Netcom user to query recursion yes zone ". "IN {type hint; file" named. ca ";}; zone" abc.com "IN {type master; file" abc.com. wt. zone "};}; after finishing the above work, Press esc and enter: w! And: q! Save and exit. Go to the/var/named folder (If chroot is created, the path is/var/named/chroot/var/named), and set the localhost. copy the zone file to the current directory and name it abc.com. dx. zone and abc.com. wt. zone, open and edit the corresponding records in it. The address segments resolved to the records are 10.0.0.0, 11.0.0.0, 255.0.0.0, or 21.0.0.0. After saving and exiting, run the service named reload command to refresh the DNS service. Then, run the nslookup command to test the two machines whose IP segments are 10.0.0.0, 11.0.0.0, 255.0.0.0, or 21.0.0.0 respectively. If the obtained IP address and Host IP address are in the same CIDR block, the view takes effect. If the view is not in the same CIDR Block, the view configuration is incorrect! To make the view take effect, ensure that the resolution in the record file must correspond to the IP address segment declared in the view! # The comment is behind the #. When writing the configuration file, pay attention to the semicolons and braces in it. There must be no less than one!

Related Article

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.