The UNIX system is a very popular network operating system that uses its domain name service function to establish a domain name system for enterprise internal network intranet, which can manage the network, easy to operate email, file transfer, web browser, etc. Internet Tools. . The domain name system domain name is a high-level address form introduced in the computer network. The purpose of the domain name system is to solve the problem of ever-priced computer name conflicts in the network through hierarchical structures. The domain name system contains two aspects: domain name command, domain name resolution. The domain name command is carried out using a reverse-growing tree structure similar to the UNIX file system. The root is on the top, with an empty string to make an identifier, and each node in the tree uses a simple string to identifically, representing one of the domain system, each domain, can be further divided into subdomains. The domain name is a full name of the domain to the root of the root, and these identifiers are separated by ".". For example, the domain name kj.jx.hb.cn consists of four identifiers, indicating a computer where the name is KJ, and the suffix of KJ indicates that the domain where the computer is located. After the domain name is correct, you will perform domain name analysis. The so-called domain name resolution is the mutual mapping between domain names and IP addresses. The domain name is mapped to the IP address called forward parsing, and the IP address is mapped to the domain name reverse analysis. The distributed database technology is applied in the domain name system. When the domain name analysis, the client / server mode is used. The client is called the domain parser, mainly proposes the domain name resolution application, the server, and the server is responsible for controlling the local domain name database and parsing. The local parser and the local server are directly connected. Most names are parsed locally. Only a few networks are transmitted to other servers parsing, first accessing local servers, if they don't, access other servers. In order to improve the analytical efficiency, a dedicated cache area is opened in the server, and the recently parsed name, the application is used, and the record used by the description of the domain name server location. The domain name system of the domain name system in the UNIX system is a client / server software system. The server part is actually a daemon called NAMED, running on the specified computer (called a domain name server). The machine includes some information for the entire domain name database, which is available to the resolver to access the query, and the main function is parsing, mapping, and cache. The domain name parser is not a separate customer program, but is implemented in a program of the Telnet and FTP in a library routine. The main function is to send a query, wait a response. Therefore, the establishment of domain name systems in the UNIX system includes two parts: parsers and servers. 1. The configuration generation of the parser parser is relatively easy, just set one file /etc/resolv.conf, which is a simple text file, two data parameters (Nameserver and Domain) need to be defined, formatted Yes: Nameserver address DMAIN domain where: Nameserver parameter defines the server of the parser query domain information in the form of an IP address. The server is sequentially queried in the order of the files in the file. If the response from the first server is not received, try the second server listed in the query file until all the servers listed are. The Domain parameter defines the default domain name. The parser adds the default domain name to all hostnames that do not include the suffix, then use the extended host name to the domain name server query analysis.
2. Domain Name Service Software Named in the Server Unix system When you first check the file /etc/named.boot defined domain name database information source, then access each zone file constituting the domain name database according to the instructions of the file (Cache Area file NAMED. Cache, self-retrore district file named.local, domain name address zone name file named.hosts, and reverse domain zone file named.rev), so the configuration generation of the server is much more complicated than the parser, and sets a set of files separately. . First, the named.boot file indicates the source of the domain name system to the Named daemon, which determines the function of the domain name server. The definition format of the main configuration parameters is: Directory Directory Primary Domain Name File Name SECONDARY Domain Name Address Area File Name Cache Domain Name District File Names in which Directory defines the directory where the definition statement PRIMARY, etc. is defined as / etc / named. PRIMARY defines the area of the area of the primary domain server. Secondary defines the host that is 162.132.1.1 is an auxiliary domain server. Cache defines the cache area file responding to the domain name server and initializes the buffer with its content. Second, the other zone file indicated in the named.boot file actually stores domain database information, and uses the same type of record format to define the database, the record format is defined as: [Name] [TTL] in Type Data record format in each parameter The specific meaning is: NAME defining the name of the reference domain object; TTL defines the length of time in seconds; the IN definition record is the Internet DNS record; TYPE definition records; DATA defines the specific content of the record type. The main record types defined by the parameter TYPE have the following: SOA (Start of Authority) The beginning of the area file is defined to affect the parameters of the entire area. NS (Name Server) marked domain domain name servers. A (address) mapping domain named IP address. PTR (Pointer) mapping the IP address to the domain name. MX (MAIL Exchange) indicates that the email should be transmitted. CName (Canonical Name) defines an alias of the host name. Third, the Unix system has an example of various zone files, and the actual application is appropriately modified by the definition of the definition in the area to generate its own file. The following separately describes the configuration of each file: 1NAMed.local The file named.local file is a zone file of 0.0.127.in_addr.arpa, converts the IP address 127.0.0.1 to the name of the host host, because the UNIX system uses 127.0.0.1 to do the computer's own IP address, so the server Files are the same. 2Named.rev file named.rev file is an address domain 12.162.in_addr.arpa zone file, map the IP address within the 162.12.0.0 network segment into a computer domain name, the IP address in the area file is reversed, such as address 162.12.2.1 Write 1.2 at the Name parameter of the district file. 3Named.hosts file named.hosts file maps the domain name to the IP address, so A records, in addition, you can define the alias of your computer and email servers, such as Mail's alias is NS, and the email server is MAIL. The 4Named.cache file named.cache file contains information necessary when the current domain name server starts and starts to create a data cache, basically NS record and A record.