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/hvtong.com. 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 "0.0.127.in-addr. arpa "{
Type master; # indicates that the server is a primary Domain Name Server
File "named. local ";
};
Zone "0.168.192.in-addr. arpa" {# define the network segment to be interpreted
Type master;
File "com. hvtong. zone ";
};
Zone "hvtong.com" in {# domain name to be interpreted
Type master;
File "hvtong.com. zone ";
};
2./var/named/hvtong.com. zone
  
(Forward resolution configuration file, that is, the corresponding domain name to IP address)
  
Source file:
@ In soa www.hvtong.com. root.www.hvtong.com
# All partition files start with SOA and @ specifies the current information source. The value www.hvtong.com 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 www.hvtong.com
# Define a Domain Name Server
In mx 10 mail.hvtong.com
# Define the email server. "10" indicates the priority. The smaller the value, the higher the priority.
# Map domains to IP addresses:
Localhost in a 127.0.0.1
Www in a 192.168.0.1
Mail in a 192.168.0.1
Pop3 in a 192.168.0.1
Smtp in a 192.168.0.1
@ In a 192.168.0.1
3./var/named/com. hvtong. zone
  
: DNS reverse resolution configuration file, that is, ing IP addresses with very domain names
  
Source file:
@ In soa www.hvtong.com. root.www.hvtong.com .(
1997022700; Serial
28800; Refresh
14400; Retry
3600000; Expire
86400); Minimum
In ns www.hvtong.com
In mx 10 mail.hvtong.com.
1 in ptr www.hvtong.com
# 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 www.hvtong.com and 192.168.0.1.
4./etc/hosts
  
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:
127.0.0.1 localhost. localdomain localhost
192.168.0.1 www.hvtong.com 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:
Domain hvtong.com
# Define a local domain name.
Search hvtong.com
# Simplify the host name entered by the user, that is, when the user inputs mail, the DNS can
It is successfully parsed as mail.hvtong.com. It is mutually exclusive with the domain, regardless
Who appears is used to define the search list.
Nameserver 192.168.0.1
# 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.
  
Test
  
1. The administrator needs to execute/etc/rc. d/init. d/named after modifying the DNS configuration file.
Restart.
  
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 127.0.0.1, 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 192.168.0.1 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: 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.