DNS working principle, forward and backward parsing and master-slave synchronization

Source: Internet
Author: User

Basic working principle of DNS, and forward and backward parsing and master-slave synchronization
First, the definition
DNS (domain Name System), the Internet as the domain name and IP address of each other
Mapping of a distributed database, enabling users to access the Internet more easily, without having to remember to be
The number of IP strings that the machine reads directly. The process of obtaining the IP address of the host name through the hostname is called
Domain name resolution.
Bind:bekerley internat name daemon, network domain name management software.
Second, the principle
1. Types of DNS Servers
Primary DNS server (domain name resolution within domains, maintained by administrator)
From a DNS server (an alternate DNS server within a domain to obtain a parse library through zone transfer)
Cache DNS Server (the DNS server of the running business, responsible for client domain name resolution)
2. DNS Query type
Recursion: Send a request to get an answer (client access to DNS server)
Iteration: Send multiple requests to get answers (DNS server access domain name)
3. Type of resolution:
Name-->ip forward parsing
Ip--name Reverse parsing
4, a complete domain name query request through the process:
Local Client---> View local Hosts file--local cache--Primary DNS server
--Primary DNS cache--Caching DNS servers--querying domain names by iteration
Iii. Description of the configuration file
1. Resource record: Resource RECORD,RR each domain contains resources related to it
Record type: A (IPV4), AAAA (IPV6), ptr,soa,ns,cname,mx
Soa:start of authority, starting authorization record
A:internet Address: Role: FQDN-->IP
Aaaa:fqdn-->ipv6
PTR:POINTER,IP-->FQDN Reverse parsing
Ns:name server, dedicated to DNS servers that indicate the current zone
Cname:canonical name, alias record
MX:MAIL Exchanger, mail exchanger, indicates the host receiving mail
2, bind composition:
Service script:/etc/rc.d/init.d/named
Master configuration file:/etc/named.conf,
Zone Secondary Profile:/etc/named.rfc1912.zones
/etc/rndc.key
Parse library file:/var/named/zone_name. ZONE
3. Main configuration file:/etc/named.conf
Global configuration: Options {}
Log subsystem configuration: Logging {}
Region definition: Which zones can be resolved by this machine, which zone should be defined;
4. Define the zone in the master configuration file
Zone "Zone_name" in {
type {Master|slave|hint|forward};
Master: Main Zone
Slave: from the area
Hinit: Root Hints
Forward: Forwarding
File "Zone_name.zone";
};
5. Define the Zone resolution library file
Format:
Macro definition
Resource records
Example: Forward parsing
$TTL 86400; define default cache time
$ORIGIN king.com. ; Define the origin domain name
@ in SOA ns1.king.com. Admin.king.com (
2015042201 Serial Number
1H Refresh Time
5M Retry Time
7D expiry time
1D) The TTL value of the negative answer
In NS NS
In MX ten MX
NS in A 172.16.21.68
MX in A 172.16.21.68
www in A 172.16.21.68
King.com in A 172.16.21.68
Iv. establishing forward and backward parsing and master-slave synchronization
1. Forward parsing the primary server
Installing bind #yum Install Bind-y
#cp/etc/named.conf{,.bak} curly brace extension, backup named.conf
#vim/etc/named.conf Modify the master configuration file

650) this.width=650, "title=" 2015-04-24 04.png "src=" http://s3.51cto.com/wyfs02/M01/6B/F0/ Wkiom1u6ulejl1jpaahsayymp6q437.jpg "alt=" wkiom1u6ulejl1jpaahsayymp6q437.jpg "/> #service named restart
#ss-TUNLP | Grep:53 viewing the listening status of the 53-port TCP,UDP
#vim/etc/named.rfc1912.zones defined Area

650) this.width=650, "title=" 2015-04-24 39.png "src=" http://s3.51cto.com/wyfs02/M00/6B/F0/ Wkiom1u6usqa8bdjaabefoqkrpw306.jpg "alt=" Wkiom1u6usqa8bdjaabefoqkrpw306.jpg "/>

#cd/var/named
#vim King.com.zone

650) this.width=650, "title=" 2015-04-24 14.png "src=" http://s3.51cto.com/wyfs02/M02/6B/F0/ Wkiom1u6uvccrviyaadueshqxec009.jpg "alt=" Wkiom1u6uvccrviyaadueshqxec009.jpg "/>

#named-checkconf Checking the master configuration file
#named-checkzone "King.com"/var/named/king.com.zone check the Zone profile syntax error
#chmod 640 King.com.zone Modify Permissions
#chown: Named King.com.zone modified genera Group
#service named restart
View service Status #rndc status
#dig-T A www.king.com @172.16.21.68 View the domain name IP from this computer

650) this.width=650, "title=" 2015-04-24 24.png "src=" http://s3.51cto.com/wyfs02/M01/6B/ED/ Wkiol1u6vj6svmyaaajdgsvbssk987.jpg "alt=" wkiol1u6vj6svmyaaajdgsvbssk987.jpg "/>2, reverse resolve primary server
#cd/var/named
#vim 172.16.21.zone

650) this.width=650, "title=" 2015-04-24 30.png "src=" http://s3.51cto.com/wyfs02/M01/6B/ED/ Wkiol1u6vitxh3koaadqi2cioby185.jpg "alt=" Wkiol1u6vitxh3koaadqi2cioby185.jpg "/>
#vim/etc/named.rfc1912.zones

650) this.width=650, "title=" 2015-04-24 06.png "src=" http://s3.51cto.com/wyfs02/M01/6B/ED/ Wkiol1u6vgiqmymlaabvmhttfrm405.jpg "alt=" Wkiol1u6vgiqmymlaabvmhttfrm405.jpg "/>

#chmod 640 172.16.21.zone
#chown: Named 172.16.21.zone
#named-checkzone "21.16.172.in-addr.arpa" 172.16.21.zone
#named-checkconf
#service named restart
#rndc status
#dig-X 172.16.21.68 @172.16.21.68

650) this.width=650, "title=" 2015-04-24 56.png "src=" http://s3.51cto.com/wyfs02/M00/6B/ED/ Wkiol1u6vunroe32aakdg2qj0xi124.jpg "alt=" Wkiol1u6vunroe32aakdg2qj0xi124.jpg "/>3, forward parsing from server
#dig-T AXFR king.com @172.16.21.68 Test zone transfer
#yum Install Bind-y
#vim/etc/named.conf

650) this.width=650, "title=" 2015-04-24 53.png "src=" http://s3.51cto.com/wyfs02/M02/6B/ED/ Wkiol1u6vr3jntgmaagqtrwggo8901.jpg "alt=" wkiol1u6vr3jntgmaagqtrwggo8901.jpg "/> #service named start
#ss-TUNL
#vim/etc/named.rfc1912.zones

650) this.width=650, "title=" 2015-04-24 43.png "src=" http://s3.51cto.com/wyfs02/M02/6B/F1/ Wkiom1u6vxfdzp3naabqoufmets628.jpg "alt=" Wkiom1u6vxfdzp3naabqoufmets628.jpg "/>
#service named restart
#rndc Reload Synchronization
#tail/var/log/messages View Logs
4. Reverse parsing from the server
#vim/etc/named.rfc1912.zones

650) this.width=650, "title=" 2015-04-24 28.png "src=" http://s3.51cto.com/wyfs02/M00/6B/ED/ Wkiol1u6vvecsxt8aab2-o-o66y066.jpg "alt=" Wkiol1u6vvecsxt8aab2-o-o66y066.jpg "/>

#named-checkconf
#rndc Reload
#tail/var/log/messages




This article is from the "Linux class notes" blog, so be sure to keep this source http://linuxkingdom.blog.51cto.com/6334977/1638157

DNS working principle, forward and backward parsing and master-slave synchronization

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.