DNS (protocal):D omain name Server domain namespace
www.baidu.com there is a (.) behind. Dot is the root name server, there are 13 global
DNS query: There are two types of recursion and iteration
Recursion: A first-level upward query back down a<-->b<-->c<-->d
Iterations: Polling queries return a<-->b, A<-->c, a<-->d
Fqdn:full qualified domain name fully qualified domainname/full name Domain
Organization domain:. com. org. net. mil. edu. gov, etc. some organizational management
Country domain:. CN. US UK etc. represent domain names for some countries
Reverse domain:. In-addr.arpa managed by the IANA
Zone zone, used to configure the parse library locally
The resource record type RR (resource record) is used for the properties that this record resolves
Ns:name Server,zone Library can have multiple
Soa:start of authority, starting authorization record there can only be one in a zone library.
Mx:mail Exchange, mail exchanger
Priority (0-99)
A: The Forward parsing library, FQDN to IPV4 frequently used address resolution
PTR: Reverse Parse library, IP to FQDN
AAAA: Forward parsing library, FQDN to IPV6
Cname:canonical Name, official title (alias record)
Domain domains are used to register for zone-based implementations
Authoritative DNS server: A server that holds all host name resolution in a domain, requires an alternate
Bind (Package): Bekerley Internet Name Domain
Process script:/etc/rc.d/init.d/named
Conf:/etc/named.conf,/etc/named.rfc1912.zones
Zone Parse library file:/var/named/zone_name.zone
Note: To run as a system user in order to secure the process, run under the chroot model
Install bind
[email protected] ~]# Yum install bind-y
View named.conf
[Email protected] ~]# vim/etc/named.conf
Based on not running on the internet, so comment out some options
options { //listen-on port 53 { 127.0.0.1; }; listening on which fracture and IP address, note: Curly braces to have spaces //listen-on-v6 port 53 { ::1; }; directory "/var/named"; Define working directory, parse library, etc. find location dump-file "/var/named/data/cache_dump.db"; statistics-file "/var/named/data/named_stats.txt"; //memstatistics-file "/var/named/data/named_mem_stats.txt"; //allow-query { localhost; }; Allow queries recursion yes; whether recursion is allowed //dnssec-enable yes; //dnssec-validation yes; //dnssec-lookaside auto; /* Path to isc dlv key */ //bindkeys-file "/etc/named.iscdlv.key"; //managed-keys-directory "/ Var/named/dynamic ";}; logging { channel default_debug { file "Data/named.run" ; severity dynamic; file "Data/named.run"; severity dynamic; };}; zone "." IN { type hint; Root Type file "named.ca"; 13 root domain Servers };include "/etc/named.rfc1912.zones"; Include this path profile //include "/etc/named.root.key";
View Name.rfc1912.zones
[Email protected] ~]# Vim/etc/named.rfc1912.zones
zone "Localhost.localdomain" IN { type master; file "Named.localhost"; allow-update { none; };}; zone "localhost" IN { type master; file "Named.localhost"; allow-update { none; };}; zone "1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.ip6.arpa" IN { type master; file "Named.loopback"; allow-update { none; };};i Reverse parsing of Pv6 zone "1.0.0.127.in-addr.arpa" IN { type master; file "Named.loopback"; 33,2-9 top type master; file "Named.loopback"; allow-update { none; };}; Reverse parsing of 127.0.0.1 zone "0.in-addr.arpa" IN { type master; file "Named.empty"; allow-update { none; };}; Add the following lines: Zone "baidu.com" in { type master; &NBSP;FILe "Baidu.com.zone";};
Create parse library file
[[email protected] ~]# cd/var/named/[[email protected] named]# vim baidu.com.zone$ttl 3600@ in & nbsp soa ns.baidu.com. admin.gmail.com. 2015060701 1h 5m &N Bsp 1w 1d) in ns ns . baidu.com. in &NBSP;MX 10 mail.baidu.com.ns.baidu.co M. in a 1.1.1.1mail.baidu.com. In a 1.1.1.2 www.baidu.com. in a 1.1.1.3pop.baidu.com. in cname mail.baidu.com.
Determine permissions
-rw-r--r--. 1 root root 255 June 7 08:16 baidu.com.zonedrwxrwx---. 2 named named 4096 June 7 07:34 datadrwxrwx---. 2 named named 4096 May 06:27 Dynamic-rw-r-----. 1 root named 2075 Apr named.ca-rw-r-----. 1 root named Dec named.empty-rw-r-----. 1 root named June Named.localhost-rw-r-----. 1 root named 168 Dec named.loopbackdrwxrwx---. 2 named named 4096 May 06:27 Slaves[[email protected] named]# chgrp named baidu.com.zone [[email protected] named]# CHM OD 640 baidu.com.zone [[email protected] named]# RNDC Reload
Check for syntax errors
[Email protected] ~]# service named Configtest
Start
[[Email protected] ~]# service named Startgenerating/etc/rndc.key: [OK]; random number generator Start ing named: [OK]
View status
[[Email protected] ~]# service named statusversion:9.8.2rc1-redhat-9.8.2-0.30.rc1.el6_6.3 software version CPUs found:1cpu number of worker Threads:1 worker thread number of zones:20 Zone area debug level:0 xfers running:0xfers Deferred:0soa queries in progress: 0query logging is off query area off recursive clients:0/0/1000 TCP clients:0/100server is up and runningnamed (PID 24383) is Ru Nning ...
Test
[[email protected] named]# host-t A www.baidu.com 127.0.0.1Using domain server:name:127.0.0.1address:127.0.0.1# 53aliases:www.baidu.com has address 1.1.1.3[[email protected] named]# host-t SOA baidu.com 127.0.0.1Using domain SE Rver:name:127.0.0.1address:127.0.0.1#53aliases:baidu.com has SOA record ns.baidu.com. admin.gmail.com. 2015060701 3600 604800 86400[[email protected] named]# host-t MX baidu.com 127.0.0.1Using domai n server:name:127.0.0.1address:127.0.0.1#53aliases:baidu.com Mail is handled by ten mail.baidu.com. [[email protected] named]# nslookup> set type=a> www.baidu.comServer: 192.168.80.128address: 192.168.80.128#53name:www.baidu.comaddress:1.1.1.3> set type=mx> baidu.comserver: 192.168.80.128address:192.168.80.128#53baidu.com Mail exchanger = Ten mail.baidu.com.> [[email Protected] named]# dig-t A www.baidu.com @192.168.80.128; <<>> DiG 9.8.2rc1-redhat-9.8.2-0.30.rc1.el6_6.3 <<>> -T A www.baidu.com @192.168.80.128;; Global options: +cmd;; Got answer:;; ->>header<<-opcode:query, Status:noerror, id:6791; FLAGS:QR AA (authoritative solution) Rd RA; Query:1, Answer:1, authority:1, additional:1 message guardian related information;; QUESTION section: Query questions; www.baidu.com. in A;; ANSWER section: Answer www.baidu.com. 3600 in A 1.1.1.3; Authority section: Who answered baidu.com. 3600 in NS ns.baidu.com.; ADDITIONAL section: Supplemental Instructions ns.baidu.com. 3600 in A 1.1.1.1; Query time:0 msec;; server:192.168.80.128#53 (192.168.80.128); When:sun June 7 09:01:18 2015;; MSG SIZE rcvd:80 Full area query [[email protected] named]# [[email protected] named]# dig-t AXFR baidu.com @192.1 68.80.128; <<>> DiG 9.8.2rc1-redhat-9.8.2-0.30.rc1.el6_6.3 <<>>-t AXFR baidu.com @192.168.80.128; Global options: +cmdbaidu.com. 3600 in SOA ns.baidu.com. admin.gmail.com. 2015060701 3600 604800 86400baidu.com. 3600 in NS ns.baidu.com.baidu.com. 3600 in MX 10 mail.baidu.com.mail.baidu.com. 3600 in A 1.1.1.2ns.baidu.com. 3600 in A 1.1.1.1pop.baidu.com. 3600 in CNAME mail.baidu.com.www.baidu.com. 3600 in A 1.1.1.3baidu.com. 3600 in SOA ns.baidu.com. admin.gmail.com. 2015060701 3600 300 604800 86400;; Query time:0 msec;; server:192.168.80.128#53 (192.168.80.128); When:sun June 7 09:05:26 2015;; XFR Size:8 Records (Messages 1, Bytes 219)
Rndc:remote Name domain controller listens on port 953
Local use, for reload configuration files, etc.
This article from "Linux_mayi" blog, reproduced please contact the author!
DNS Service and Configuration