DNS configuration example

Source: Internet
Author: User
Tags domain name server nameserver subdomain subdomain name
Article Title: DNS configuration example. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
DNS Server configuration example:
  
Note: The above example file is only used for demonstration. It is different from the actual content and may differ from the actual test. For basic DNS knowledge, see the PowerPoint slide file prepared by myself. The URL is the same as above and the file name is dns.ppt.
  
1. first, make sure that your superior Domain Name Server has correctly pointed to your DNS Server. For example, the subdomain I set is net.dlut.edu.cn, the NS record of the LINUX machine that is used as the net.dlut.edu.cn subdomain name server should be found on the Domain Name Server of dlut.edu.cn. The following is the content of the corresponding file on the dlut.edu.cn Domain Name Server:
(1) BIND 4.9.x configuration file
--------------------------/Etc/named. boot ----------------------
Directory/etc/namedb
;
Primary dlut.edu.cn db. dlut
Primary 66.118.202.in-addr. arpa db.202.118.66
;
;
Primary 0.0.127.in-addr. arpa localhost. rev
Secondary net.dlut.edu.cn 202.118.65.1 db.net. dlut
Secondary 65.118.202.in-addr. arpa 202.118.65.1 db.202.118.65
;
; Load the cache data last
Cache. named. root
  
(2) Bind-8.x configuration file/etc/named. conf
// Generated by named-bootconf.pl
  
Options {
Directory "/etc/namedb ";
/*
* If there is a firewall between you and nameservers you want
* To talk to, 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;
};
  
// Type domain source host/file backup file
Zone "."{
Type hint;
File "named. root ";
};
  
Zone "0.0.127.IN-ADDR. ARPA "{
Type master;
File "localhost. rev ";
};
  
Zone "66.118.202.IN-ADDR. ARPA "{
Type master;
File "db.202.118.66 ";
};
  
Zone "dlut.edu.cn "{
Type master;
File "db. dlut ";
};
  
Zone "net.dlut.edu.cn "{
Type slave;
File "db.net. dlut ";
Masters {
202.118.65.1;
}
};
  
Zone "65.118.202.IN-ADDR. ARPA "{
Type slave;
File "db.202.118.65 ";
Masters {
202.118.65.1;
}
};
-------------------------/Etc/namedb/db. dlut -------------------
@ In soa cedrus.dlut.edu.cn. hbwork.dlut.edu.cn.
99060205 10800 4800 604800 432000)
In ns cedrus.dlut.edu.cn.
In ns gingko.dlut.edu.cn.
In ns olive.dlut.edu.cn.
In mx 1 gingko.dlut.edu.cn.
  
Localhost in a 127.0.0.1
Cedrus in mx 1 gingko.dlut.edu.cn.
In a 202.118.66.6
  
Linden in a 202.118.66.88
In mx 1 linden.dlut.edu.cn.
Ftp in cname linden.dlut.edu.cn.
Banyan in cname linden.dlut.edu.cn.
  
Gingko in mx 10 gingko.dlut.edu.cn.
In a 202.118.66.8
Mail in cname gingko.dlut.edu.cn.
  
Rose in mx 1 rose.dlut.edu.cn.
In a 202.118.66.5
In a 202.118.69.6
Bbs in cname rose.dlut.edu.cn.
Bbs1 in a 202.118.69.6
  
Lib604800 in ns ns.lib.dlut.edu.cn.
Ns. lib 604800 in a 202.118.68.241
  
Network 26000 in ns dns.net.dlut.edu.cn.
In ns cedrus.dlut.edu.cn.
Dns.net in a 202.118.65.1
In a 202.118.66.13
  
Olive in a 202.118.70.1
In a 202.118.71.1
In a 202.118.66.16
In a 202.118.68.1
In a 202.118.69.1
In mx 1 olive.dlut.edu.cn.
  
Peony in a 202.118.66.18
Www in cname peony.dlut.edu.cn.
Mirror in cname peony.dlut.edu.cn.
      
  
You can use nslookup to check whether the settings are correct, as shown below:
> Net.dlut.edu.cn
Server: cedrus.dlut.edu.cn
Address: 202.118.66.6
  
Non-authoritative answer:
Net.dlut.edu.cn nameserver = dns.net.dlut.edu.cn
Net.dlut.edu.cn nameserver = cedrus.dlut.edu.cn
  
Authoritative answers can be found from:
Dns.net.dlut.edu.cn internet address = 202.118.65.1
Dns.net.dlut.edu.cn internet address = 202.118.66.13
Cedrus.dlut.edu.cn internet address = 202.118.66.6
  
** Skip this step if you only want to use the local DNS Server or you are not connected to the Internet.
  
2. Edit the corresponding file of the net.dlut.edu.cn DNS server,
(1) Bind 4.9.x/etc/named. boot contains the following content, with the content starting with quotation marks as a comment:
  
Directory/etc/namedb; specifies the directory of the named initialization file,
; It is better to be a single file system, such
;/Var/namedb/usr/local/namedb
  
; Cache points to the list of top-level domain name servers
Cache. root. cache
  
Primary indicates the subdomain net.dlut.edu.cn and the Reverse Domain 65.118.202.IN-ADDR. ARPA.
The master Domain Name Server, whose initialization files are/etc/namedb/db.net. dlut and
;/Etc/namedb/db.202.118.65
Primary net.dlut.edu.cn db.net. dlut
Primary 65.118.202.IN-ADDR. ARPA db.202.118.65
  
Local loopback domain 0.0.127.IN-ADDR. ARPA master Domain Name Server
Primary 0.0.127.IN-ADDR. ARPA localhost. rev
  
The backup Domain Name Server of the subdomain name dlut.edu.cn, from the Domain Name Server 202.118.66.6 (primary
; Server for domain dlut.edu.cn) and 202.118.66.8 (secondary server
Domain dlut.edu.cn) apply for relevant data, the backup file name is dlut. bak
If the Domain Name Server is not backed up, the following lines are not required.
Secondary dlut.edu.cn 202.118.66.6 202.118.66.8 dlut. bak
Secondary 66.118.202.IN-ADDR. ARPA 202.118.66.6 202.118.66.8 dlut. rev. bak
  
(2) The bind-8.x that can be provided to convert the contents of the above file to the named required by bind8. conf, where the namedboot-conf.pl can be found under/usr/doc/bind */on redhat, or from the bind8 code package, its usage is as follows:
  
$ Namedboot-conf.pl named. boot> named. conf
  
Copy the generated named. conf file to the/etc directory.
     
3. Create the/etc/namedb/db.net. dlut file, which can be modified from the sample file carried by the bind package. The file content is as follows:
-----------------------------------------------------------------------
;
; Data file of hostnames in this zone.
;
@ In soa dns.net.dlut.edu.cn. hbwork.dlut.edu.cn .(
960072601; Serial
300; Refresh-5 minutes
60; Retry-1 minute
38400; Expire-2 weeks
43200); Minimum-12 hours
In ns ns.net.dlut.edu.cn.
In ns cedrus.dlut.edu.cn.
; Define localhost
;
Localhost in a 127.0.0.1
  
Ns in a 202.118.65.1
     

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.