DNS (domain Name System)
DNS (domain Name System), a distributed database of domain names and IP addresses that are mapped to each other on the Internet, makes it easier for users to access the Internet without remembering the number of IP strings that can be read directly by the machine. The process of obtaining the IP address of the host name through the hostname is called Domain name resolution (or hostname resolution). The DNS protocol runs on top of the UDP protocol, using the port number 53. RFC 2181 has a canonical description of DNS in RFC 2136, a description of dynamic updates to DNS, and RFC 2308 describes the reverse caching of DNS queries.
The DNS process diagram can simply explain how DNS works
DNS Query type:
Recursive query
Iterative queries
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/73/68/wKioL1X88prCoobZAAVeZ8seHRw122.jpg "title=" 024f78f0f736afc34ce8c930b319ebc4b64512fa[1].jpg "alt=" Wkiol1x88prcoobzaavez8sehrw122.jpg "/>
Type of DNS server:
Primary DNS Server
Secondary DNS server
Caching DNS servers
Transponder
Primary DNS server: maintains the resolved library server in the domain responsible for parsing, and the analytic library is maintained by the management;
From a DNS server: "Copy" (zone transfer) a parse library from the primary DNS server or other from the DNS server;
2015042201 serial number: Resolves the version number of the library, the premise: the main server parsing library content changes, its sequence increment;
2H Refresh interval: The time interval from the server requesting the synchronization of the resolution library from the primary server;
10M retry interval: The time interval that is retried when the server requests synchronization from the primary server to resolve a library failure;
1W Expiration Time: When the primary server is always not contacted from the server, how long after the abandonment from the server perspective, stop providing services;
Common resource record types
A address this record lists the IP addresses for a specific host name. This is an important record for name resolution.
CNAME Standard Name This record specifies the alias of the standard host name.
MX Mail exchanger This record lists the hosts responsible for receiving e-mail messages sent to the domain.
NS Name server This record specifies the name server that is responsible for the given zone.
PTR remembers the hostname IP address, reverse the meaning of the solution, IP in turn, after appending in-addr.arpa
And then we'll do an example to see
We install bind directly with Yum: Note that because we have bind on the CD, we do not have to download the package, if need to download can be used to download the official website. Use RPM to install, you can see the RPM manual.
You can use YUM-QA to view bind packages
Yum Install bind Bind-utils
You can also use the Yum install bind* to load all bind packages.
Master configuration file:
Global configuration: Options {}
Log subsystem configuration: Logging {}
Region definition: Which zones can be resolved by this machine, which zone should be defined;
Zone "Zone_name" in {}
Note: If any service program expects that it can be accessed through the network by other hosts, it should at least listen on an IP address that can communicate with the external host;
Configuration of the cache name server:
The external address can be monitored;
Dnssec
It is recommended to turn off DNSSEC when testing;
Primary DNS name servers:
(1) Define a zone in the master configuration file
Zone "Zone_name" in {
type {Master|slave|hint|forward};
File "Zone_name.zone";
};
Defines a zone resolution library file. Example to see
650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/73/6B/wKiom1X8-ymyAHpEAAEiRqmKU4U360.jpg "title=" 12.png "alt=" Wkiom1x8-ymyahpeaaeirqmku4u360.jpg "/>
Test command: Use of dig
Dig [-T type] name [@SERVER] [query options]
Dig is used to test the DNS system, so the hosts file is not queried for parsing;
Query options:
+[no]trace: Trace parsing process
+[no]recurse: Recursive parsing
Test Reverse resolution:
Dig-x IP @SERVER
Analog zone transfer:
Dig-t AXFR zone_name @SERVER
Example: Dig-t AXFR magedu.com @172.16.100.11
Host command:
Host [-T type] name [SERVER]
nslookup command:
nslookup [-option] [name |-] [Server]
$TTL 86400
$ORIGIN 100.16.172.in-addr.arpa.
@inSOAns1.magedu.com. Admin.magedu.com. (
2015042201
1H
5M
7D
1D)
InNSns1.magedu.com.
InNSns2.magedu.com.
one inPTRns1.magedu.com.
one inPTRwww.magedu.com.
inPTRmx1.magedu.com.
inPTRwww.magedu.com.
inPTRmx2.magedu.com.
Define the method from the zone:
Zone "Zone_name" in {
Type slave;
Masters {master_ip;};
File "Slaves/zone_name.zone";
};
This article is from the "hard disk partition Logical Volume" blog, so be sure to keep this source http://10442897.blog.51cto.com/10432897/1696278
DNS implementation and Management