Establishment of Domain Name System on UNIX System

Source: Internet
Author: User
Tags domain name server mail exchange name database nameserver nslookup nslookup tool to domain
UNIX is a very popular network operating system. Using the Domain Name Service function provided by UNIX, it establishes a Domain Name System for the Enterprise Intranet, which can effectively manage the network, it is convenient for users to operate Internet tools such as email, file transmission, and Web browsers.

Domain Name System
Domain names are an advanced address format introduced in computer networks for ease of use, the domain name system aims to solve computer name conflicts that are easy to occur in the network through hierarchical domain names, so that management is decentralized. the domain name system includes two aspects: domain name commands, domain name resolution.

Domain name commands are implemented in a tree structure similar to the reverse growth of UNIX file systems. At the top of the tree, each node in the tree uses a simple string as the identifier, indicating a domain in the domain name system. Each domain can be further divided into subdomains. The full name of a domain name is a sequence of identifiers from the domain to the root, and these identifiers are separated. For example, the domain name is composed of four identifiers, indicating a computer named kJ. The suffix of KJ indicates the domain where the computer is located.

After a domain name is correctly named, domain name resolution is the ing between the domain name and the IP address. The domain name is mapped to the forward resolution of the IP address, and the IP address is mapped to the reverse resolution of the domain name. The Distributed Database technology is used in the domain name system. The Client/Server mode is used for domain name resolution. The client is called the domain name parser and the Domain Name Server is called the Domain Name Server, controls the local domain name database and resolution. The local parser is directly connected to the local server. Most of the names are resolved locally, and only a few are transmitted to other servers over the network for resolution. when parsing, the local server is accessed first. Otherwise, the local server is accessed. To improve resolution efficiency, a dedicated cache is opened on the server for storing recently resolved names, application addresses, and records describing DNS server locations.

Establishment of Domain Name System in UNIX System
The domain name system in UNIX is a client/server software system. The server part is actually a daemon called named and runs on a specified computer (called a Domain Name Server, this machine includes part of the information of the entire domain name database, which can be accessed and queried by the parser. Its main functions include parsing, ing, and caching. The domain name parser is not a separate client program, but compiled into programs such as telnet and FTP in the form of Library Routines. The main function is to send queries and wait for responses. Therefore, the establishment of Domain Name Systems in UNIX systems includes the configuration and generation of the parser and server.

1. parser

The parser configuration is easy to generate. You only need to set a file/etc/resolv. conf, which is a simple text file. When configured, two data parameters (nameserver and domain) need to be defined. The format is:

Nameserver address

Dmain Domain Name

The nameserver parameter defines the server on which the parser queries domain name information in the form of an IP address. The server is queried sequentially according to the order in which the file appears. If the response from the first server is not received, try to query the second server listed in the file, until all servers listed are tried.

The domain parameter defines the default domain name. The parser adds the default domain name to all host names that do not include the suffix, and then sends the extended Host name to the Domain Name Server for query and resolution.

2. Servers

When the Domain Name Service software named in UNIX is started, check the file/etc/named that defines the source of domain name database information. boot, and then access the files in various zones that constitute the domain name database (the cache file named. cache, anti-zone file named. local, domain name to address area file named. hosts and named. rev), so the server configuration generation is much more complex than the parser, and you need to set up to generate a group of files separately.

First, the named. boot file specifies the source of the domain name system for the named daemon and determines the function of the Domain Name Server. The definition format of its main configuration parameters is:


Primary Domain Name

Secondary domain name address area file name

Cache Domain Name

Directory defines the directory in which the partition files such as the Definition Statement primary are located as/etc/named.

Primary defines the partition name of the Primary Domain Name Server.

The host whose secondary is defined as is a secondary Domain Name Server.

The cache defines the cache file that the Domain Name Server responds to and uses its content to initialize the cache.

Second, named. the other zone files indicated in the boot file actually store the domain database information and use the same type of record format to define the database. The record format is defined as [name] [TTL] In type data.

The specific meanings of parameters in the record format are as follows: name defines the name of the domain object referenced in the record; TTL defines the length of time in seconds; In defines the record as an Internet DNS record; type defines the record type; data defines the specific content of the record type. The type parameter defines the following types of records:

SOA (start of authority) indicates the beginning of a zone file and defines parameters that affect the entire zone.

NS (Name Server) indicates the Domain Name Server.

A (Address) maps domain names to IP addresses.

PTR (pointer) maps IP addresses to domain names.

Mx (mail exchange) indicates the location where the email should be sent.

Cname (canonical name) defines the alias of the host name.

Third, the UNIX system is installed with examples of files in each zone. In actual applications, you can modify, add, delete, and generate your own files according to the definition of the zone file record, the following is an example of the configuration of each file:

1named. Local file

Named. the local file is _ ADDR. the ARPA zone file converts the IP address to the name of the local host. Because the UNIX system uses as the computer's own IP address, the file is the same on each server.

2named. Rev File

Named. the Rev file is the address domain _ ADDR. the ARPA zone file maps the IP addresses in the CIDR block to the computer's domain name. The IP addresses in the records defined in the zone file are in reverse order, for example, the address is written as 1.2 In the name parameter of the zone file.

3named. Hosts file

Named. the hosts file maps the domain name to the IP address. Therefore, the record is the most. In addition, you can also define the computer alias and email server. For example, the mail alias in the file is ns, the email server is mail.

4named. cache file

The named. cache file contains the information required when the current domain name server starts and starts to create a data cache, which is basically an NS record and a record.

Detection of Domain Name Systems in UNIX systems
The UNIX system provides the NSLookup tool package for checking the domain name system. Its function is to directly query the Domain Name Server and retrieve any information that the domain name system should know. This software is useful in determining whether the server is correctly running and configured, and in querying information provided by the remote server.

Run NSLookup without any parameters on the command line of the UNIX system to enter the interaction mode. Enter help at the interaction prompt to get all the operations and functions of the software, and enter exit to terminate the interaction mode. At the same time, the NSLookup program can be run directly in the command line mode. If you use the command line method to query the computer address, NSLookup displays the name and address of the Domain Name Server and the domain name and address queried.

According to the NSLookup detection, the preceding settings are correct and the Unix domain name system is successfully established.

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: 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.