Three-dns of Linux Server Deployment series

Source: Internet
Author: User
Tags syslog domain name server nslookup nslookup command subdomain

There is a lot of knowledge about DNS on the Internet, I will not talk about the principle of DNS and do noun explanation here. In this article we will take an example to describe the configuration of DNS, the experimental environment is as follows: Domain name: guoxuemin.cn, subdomain: shenzhen.guoxuemin.cn primary Domain Name server: dns.guoxuemin.cn, IP address: 192.168.99.9 secondary name server: Dns1.guoxuemin.cn,ip Address: 192.168.99.8 subdomain server: Dns.shenzhen.guoxuemin.cn,ip address: 192.168.99.202 need to resolve the following domain name: w ww.guoxuemin.cn--192.168.99.10ftp.shenzhen.guoxuemin.cn--192.168.99.203 Running platform: CentOS 5 1. installation1) First, use the command # Rpm–qa|grep bind to check if the system is installed by default. 2) Use the RPM installation, the system installation CD has its own DNS RPM installation package. Use the rpm command to install it (recommended for this type of installation). 3) Use the source installation: You can download the installation files to HTTPS://WWW.ISC.ORG/DOWNLOADABLES/11, currently the latest version is BIND-9.7.0A1, I downloaded is bind-9.6.1. Installation steps: # tar zxvf bind-9.6.1.tar.gz# cd bind-9.6.1#./configure--prefix=/usr/local--sysconfdir=/etc-localstatedir=/v Ar--disable-threads--with-openssl# make# make install use source installation setup is troublesome, so it is recommended to use RPM installation, the environment is also used in RPM installation. 2. Basic ConfigurationDNS configuration is relatively simple, as long as the configuration of the/etc/named.conf file, and then establish a forward parsing file and reverse parsing the file is OK. 1) First copy the Named.root file to the/var/named directory (the file is the root hint file). 2) Main Profile # var/etc/named.conf 3) Configure forward parsing Zone # Vi/var/named/guoxuemin.cn.zone You can use Named-checkzone to check the legitimacy of zone files. 4) Configure reverse resolution Zone # Vi/var/named/99.168.192.in-addr.arpa.zone 5) test use the named Status command to view the running status: Test using the host command: Test using the nslookup command: Use the dig command Ok to test for no exception and the primary DNS server is configured. 3. Auxiliary DNS Server ConfigurationThe installation of the secondary DNS server with the primary DNS server, you also need to copy the named.root to the/var/named directory, follow the steps above to do so, here is no longer repeated instructions. The configuration of the secondary DNS server only needs to be configured/etc/named.conf this file. #/etc/named.conf After configuration, restart the DNS service, we can use the tail command to open the log to see the secondary DNS server synchronization with the primary DNS server process: After the synchronization is complete, we can see the/var/named/slaves/ The forward parsing and reverse parsing files have been generated automatically: 4. Subdomain and Zone delegationThe subdomain is configured in the same way as the primary domain, and the/etc/named.conf file is configured first, and then the forward parsing and reverse parsing files are established. # vi/etc/named.conf # vi/var/named/shenzhen.guoxuemin.cn. Zone # Vi/var/named/99.168.192.in-addr.arpa.zone is tested in the subdomain using nslookup: Use Nslookup to test in the primary domain: The configuration of the subdomain DNS server is complete. 5. LogHow do we know if the DNS server is running, is it busy, and the load is small? To understand the health of the DNS server, you can do so by looking at the log files that are generated by the DNS server at run time. By default, bind is generated by syslog and stored in the/var/log/message file. Because the log information in this file is generated by syslog, it is not and is all about bind log information. We select all bind log information by executing the following command: # More/var/log/message|grep named >/tmp/named.log
We can then check the DNS log information by looking at the/tmp/named.log file. # Vi/tmp/named.log However, there are very few messages in the log file, mainly starting, shutting down log records, and some serious error messages. To record the health of the server in detail, you also need to configure your server's log behavior. First we set up a folder named under/var/log/and give named ownership, which is used to store the log files. Then edit the/etc/named.conf file, generate the log: # vi/etc/named.conf OK, configure, let's Test it: as shown, access to DNS records are already recorded in the log file, is not very convenient? At this point, the deployment of the DNS server is complete.

This article is from the "Tonyguo de blog" Knowledge: "blog, be sure to keep this source http://tonyguo.blog.51cto.com/379574/169718

Three-dns of Linux Server Deployment series

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.