Configuration notes: configure the DNS server in Linux

Source: Internet
Author: User

Although Microsoft has been occupying the operating system for many years, Linux has been gradually accepted by many computer users after 12 years. Here we will introduce you in detail how to configure the DNS server for Linux, it helps you learn how to configure a DNS server in Linux.

 
 
  1. // generated by named-bootconf.pl  
  2. options {  
  3. directory "/var/named";  
  4. /*  
  5. * If there is a firewall between you and nameservers you want  
  6. * to talk to, you might need to uncomment the query-source  
  7. * directive below. Previous versions of BIND always asked  
  8. * questions using port 53, but BIND 8.1 uses an unprivileged  
  9. * port by default.  
  10. */  
  11. // query-source address * port 53;  
  12. };  
  13.  
  14. //  
  15. // a caching only nameserver config  
  16. //  
  17. zone "." IN {  
  18. type hint;  
  19. file "named.ca";  
  20. };  
  21. zone "0.0.127.in-addr.arpa" IN {  
  22. type master;  
  23. file "named.local";  
  24. allow-update { none; };  
  25. };  

This part is the original content of the named. conf file automatically generated by the system after you install the bind software. "Directory" specifies the directory where dns record files are stored:/var/named. The text starting with "//" is the description text. The following two "zones" statements define the dns server root and the corresponding reverse query domain, and point out that the root record file is "name. ca, the record file of the root reverse query domain is "named. local ". These two record files are also provided by the system and do not need to be modified. This part of the named. conf file does not need to be modified.

However, we can add a line under "direders": forwarders {202.96.134.ders ;}. 202.96.134.ders is the address of the China Telecom dns server. The forwarders parameter specifies the server where the subsequent ip address is located as an alternative dns server. That is to say, the host that cannot be resolved by the local dns is sent to this alternative dns server for resolution.

 
 
  1. zone "zrs.com" IN {  
  2. type master;  
  3. file "named.zrs.com";  
  4. allow-update { none; };  
  5. };  
  6. zone "0.0.10.in-addr.arpa" IN {  
  7. type master;  
  8. file "named.zrs.com.rev";  
  9. allow-update { none; };  
  10. }; 

This part is manually added. Defines the domain "zrs.com" and the corresponding reverse query domain. "Type master" indicates that the local host is the primary dns server primary name server in the "zrs.com" and "0.0.10.in-addr. arpa" domains ). "Named.zrs.com" and "named.zrs.com. rev" are domain record files. These two files are also created by ourselves. Let's take a look at these two files.

Type 2: resource record file, which is located in the/var/named directory. This directory is defined in named. conf.
1. The content of the named.zrs.com file is as follows:

 
 
  1. @ IN SOA netfinity.zrs.com. root.netfinity.zrs.com. (  
  2. 1997022700 ; Serial  
  3. 28800 ; Refresh  
  4. 14400 ; Retry  
  5. 3600000 ; Expire  
  6. 86400 ) ; Minimum  
  7. IN NS netfinity.zrs.com.  
  8. IN MX 10 netfinity.zrs.com.  
  9. netfinity IN A 10.0.0.211  
  10. lily IN A 10.0.0.139  
  11. www IN CNAME netfinity.zrs.com.  
  12. pop3 IN CNAME netfinity.zrs.com.  
  13. smtp IN CNAME netfinity.zrs.com. 

Five types of records appear in this record file. SOA is the abbreviation Of Start Of Authority, followed by the host name Of your dns server. Here is "netfinity.zrs.com .". Note: The dot behind the host name. Remember to add these dots to the host names that appear in the record file .) NS is the name server resource record, indicating the name server in the domain. This is the dns server.

MX is the email server resource record of the email exchange, indicating the domain. You can write multiple MX records to specify multiple email servers. The priority level is determined by the number after MX. The smaller the number, the higher the priority of the email server. A is A host record that maps the host and IP address. CNAME is an alias record, which assigns different names to a host. For example, www.zrs.com and pop3.zrs.com all point to the same host netfinity.zrs.com. In this way, you have completed the Linux DNS configuration.

  1. Get started with Linux
  2. How to get started with Linux kernel code
  3. Getting Started: Linux scheduled task Cron
  4. Describes the Linux driver "Hello world !"
  5. Get started with Linux

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.