Getting Started: DNS creation and troubleshooting in Linux

Source: Internet
Author: User
Tags nslookup
Beginner: DNS creation and fault repair in Linux-Linux Enterprise Application-Linux server application information. For details, refer to the following section. Source: ChinaITLab collection

The domain name system is a distributed database that enables local control of part of the entire Distributed Database segment. Data in each segment can be accessed on the entire network through the customer/Server mode, by using the replication and cache technologies, the entire database is reliable and has good performance.
Required resources
Use System: Redhat AS 4.
Required configuration file
/Etc/named. conf system comes with Administrator Configuration
/Etc/hosts system comes with Administrator Configuration
/Etc/resolv. conf system comes with Administrator Configuration
/Etc/host. conf system comes with no need to modify
/Var/named. local system comes with no need to modify
/Var/named. ca system comes with no need to modify
/Var/named/ zone does not exist. The Administrator creates
/Var/named/com. hvtong. zone does not exist. The Administrator creates
Related tools
1. nslookup
2. dig
3. host
Note: This tool is provided to check whether DNS is configured correctly.
Note: The DNS master configuration file defines the basic parameters and source points of the domain database information, which can be stored locally or remotely on the server.
Source file:
Options {
Directory "/var/named"; # defines the path for named to read/write files
Zone "."{
Type hint; # indicates the file used to initialize the Domain Name Server at startup.
Is a clue file, and each server has a clue area.
File "named. ca"; # specify the file name to be read
Zone " arpa "{
Type master; # indicates that the server is a primary Domain Name Server
File "named. local ";
Zone " arpa" {# define the network segment to be interpreted
Type master;
File "com. hvtong. zone ";
Zone "" in {# domain name to be interpreted
Type master;
File " zone ";
2./var/named/ zone
(Forward resolution configuration file, that is, the corresponding domain name to IP address)
Source file:
@ In soa
# All partition files start with SOA and @ specifies the current information source. The value can connect the domain name with named. conf. There is usually only one @ symbol.
(1997022700; Serial # Serial number
28800; Refresh # Refresh cycle, in seconds
14400; Retry # cycle
3600000; Expire # Stop Time
86400); Minimum # time-to-live time
In ns
# Define a Domain Name Server
In mx 10
# Define the email server. "10" indicates the priority. The smaller the value, the higher the priority.
# Map domains to IP addresses:
Localhost in a
Www in a
Mail in a
Pop3 in a
Smtp in a
@ In a
3./var/named/com. hvtong. zone
: DNS reverse resolution configuration file, that is, ing IP addresses with very domain names
Source file:
@ In soa .(
1997022700; Serial
28800; Refresh
14400; Retry
3600000; Expire
86400); Minimum
In ns
In mx 10
1 in ptr
# Which 1 indicates the last IP address, which can be 0-255.
The other three IP addresses in/etc/named. conf form an IP address together, which defines the inverse relationship,
That is, the correspondence between and
Note: ing with other major computers on the Internet usually occurs as a DNS backup, that is, the Hosts table is used when the DNS system encounters a problem.
Source file: localhost. localdomain localhost www
# Since each server has several domain names that correspond to IP addresses permanently
They should be stored in the Hosts table.
5./etc/resolv. conf
Description: IP address and search sequence of the Domain Name Server.
Source file:
# Define a local domain name.
# Simplify the host name entered by the user, that is, when the user inputs mail, the DNS can
It is successfully parsed as It is mutually exclusive with the domain, regardless
Who appears is used to define the search list.
# Define the IP address of the Domain Name Server. A maximum of three IP addresses are allowed. We recommend that you use two IP addresses.
1. The administrator needs to execute/etc/rc. d/init. d/named after modifying the DNS configuration file.
2. nslookup: test whether forward and reverse Parsing is normal. Big and host tests work the same way. But it is more detailed.
Fault repair
In general, projects must be pushed together with the TAB key in the forward file. There is no dot behind the alias in the forward file. The alias in the reverse file is meaningless, but you add it. It can be a bit behind the alias or it can be skipped. It can be parsed in nslookup. However, if the former has more points, it will fail.
If rndc reload fails. You need to check whether all files have incorrect input. Or add unused projects. Or. Restart the service several more times.
In addition, if the local DNS Service IP address is, this is not acceptable, so that others cannot resolve their own domain names. It cannot be used as a DNS server. Be sure to add nameserver to the resolv. conf file. Remember that there is only one space. You cannot add equal signs or the like! The default search can be added or not added. Must be added as a large DNS.
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: 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.