BIND9 private DNS server small environment setup experiment
Source: Internet
Author: User
BIND9 private DNS server small environment build experiment 1. basic Server Configuration 1) master root server 192.168.56.1012) from root server 192.168.56.1023) COM server 192.168.56.1034) resolution server 192.168.56.1042. compile and install BI1... BIND9 private DNS server small environment build experiment 1. basic Server Configuration 1) master root server 192.168.56.1012) from root server 192.168.56.1023) COM server 192.168.56.1034) resolution server 192.168.56.104 2. compile and install BI11: 01 2013-8-22ND91) # tar xvf bind-9.6.1.tar.gz # cd bind-9.6.1 #. /configure -- prefix =/usr/local/named -- enable-threads // enable multithreading processing capability # make & Make install2) from rndc. extract named from the conf file. key # cd/usr/local/named # sbin/rndc-confgen> etc/rndc used in conf. conf # cd etc/# tail-10 rndc. conf | head-9 | sed s/# \ // g> named. conf # cat named. conf [plain] key "rndc-key" {algorithm HMAC-MD5; secret "wk7NzsvLaCobiCFxHB2LXQ =" ;}; controls {inet 127.0.0.1 port 953 allow {127.0.0.1 ;} keys {"rndc-key" ;};}; the above environment installation settings are the same on each server. 3. configure the master root server on the server whose IP address is 192.168.56.101. 1) enable named. conf, add the following content # vi named. conf [plain] key "rndc-key" {algorithm HMAC-MD5; secret "wk7NzsvLaCobiCFxHB2LXQ =" ;}; controls {inet 127.0.0.1 port 953 allow {127.0.0.1 ;} keys {"rndc-key" ;};}; options {directory "/var/named/"; pid-file "/var/named. pid "; recursion no;}; zone ". "IN {type master; file" db. root "; allow-transfer {192.168.56.102 ;};}; Where: recursion no; disable recursive query. Allow-transfer {192.168.56.102;}; allows region transfer and is only valid for the server with the given IP address. Here 192.168.56.102 is our root server 2) create a zone configuration file # cd/var # mkdir named # cd named # touch db. root # vi db. root [plain] $ TTL 86400 @ in soa @ root (12169 1 m 1 m 1 m 1 m ). in ns root. ns. root. ns. in a 192.168.56.101 com. in ns ns.com. ns.com. in a 192.168.56.103 Where: com. in ns ns.com. authorization is required. Otherwise, the address similar to My.com cannot be found during recursive parsing. 3) start BIND and test # cd/usr/local/named # sbin/named-g & # dig @ 192.168.56.101. NS [plain] root @ simb A-1:/var/named # dig @ 192.168.56.101. NS; <> DiG 9.9.2-P1 <> @ 192.168.56.101. NS; (1 server found); global options: + cmd; Got answer :;;>> HEADER <-opcode: QUERY, status: NOERROR, id: 10193; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 2; WARNING: recursion requested but not available; OPT pseudo section :; EDNS: version: 0, flags:; udp: 4096; QUESTION SECTIO N :;. in ns; answer section :. 86400 in ns root. ns .;; additional section: root. ns. 86400 in a 192.168.56.101; Query time: 19 msec; SERVER: 192.168.56.101 #53 (192.168.56.101); WHEN: Wed Aug 21 07:15:38 2013; msg size rcvd: 64 # dig @ 192.168.56.101 com. NS [plain] root @ simba-1:/var/named # dig @ 192.168.56.101 com. NS; <> DiG 9.9.2-P1 <> @ 192.168.56.101 com. NS; (1 server found); glob Al options: + cmd; Got answer:;-> HEADER <-opcode: QUERY, status: NOERROR, id: 20443; flags: qr rd; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 2; WARNING: recursion requested but not available; OPT pseudo dosection:; EDNS: version: 0, flags:; udp: 4096; question section:; com. in ns; authority section: com. 86400 in ns ns.com .;; additional section: ns.com. 86400 in a 192.168.56.1 03; Query time: 17 msec; SERVER: 192.168.56.101 #53 (192.168.56.101); WHEN: Wed Aug 21 07:18:16 2013; msg size rcvd: 65 4. configure the slave root server to enable named on the IP address 192.168.56.102. conf, add the following content # vi named. conf [plain] key "rndc-key" {algorithm HMAC-MD5; secret "JaHjteR5sZxVrMWWcOne9g =" ;}; controls {inet 127.0.0.1 port 953 allow {127.0.0.1 ;} keys {"rndc-key" ;};}; options {directory "/var/named"; pid-file "/Var/run/named. pid "; transfer-format allow-answers; recursion no ;}; zone ". "IN {type slave; file" db. root "; masters {192.168.56.101 ;}; Where: recursion no; recursive query is disabled. Masters {192.168.56.101;}; specifies the master server address, so that the master server address can be synchronized with the master root according to the refresh time specified in SOA. 2) create a zone configuration file # cd/var # mkdir named from the server. you do not need to manually create a zone file. Because the slave server will automatically update to the master server. 3) start BIND and test # cd/usr/local/named # sbin/named-g & wait for a while to confirm that the zone file has been obtained # ls/var/named/db. root # dig @ 192.168.56.102. NS [plain]; <> DiG 9.9.2-P1 <> @ 192.168.56.102. NS; (1 server found); global options: + cmd; Got answer :;;>> HEADER <-opcode: QUERY, status: NOERROR, id: 18918; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 2; WARNING: recursion requested but not Vailable; OPT pseudo SECTION:; EDNS: version: 0, flags:; udp: 4096; question section :;. in ns; answer section :. 86400 in ns root. ns .;; additional section: root. ns. 86400 in a 192.168.56.101; Query time: 12 msec; SERVER: 192.168.56.102 #53 (192.168.56.102); WHEN: Wed Aug 21 07:27:18 2013; msg size rcvd: 64 # dig @ 192.168.56.102 com. NS [plain] root @ simba-2:/usr/local/named/etc # dig @ 1 92.1656.102 com. NS; <> DiG 9.9.2-P1 <> @ 192.168.56.102 com. NS; (1 server found); global options: + cmd; Got answer :;;>> HEADER <-opcode: QUERY, status: NOERROR, id: 17412; flags: qr rd; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 2; WARNING: recursion requested but not available; OPT pseudo section:; EDNS: version: 0, flags:; udp: 4096; question section:; com. in ns; Uthority section: com. 86400 in ns ns.com .;; additional section: ns.com. 86400 in a 192.168.56.103; Query time: 19 msec; SERVER: 192.168.56.102 #53 (192.168.56.102); WHEN: Wed Aug 21 07:35:10 2013; msg size rcvd: 65 5. configure the COM server on 192.168.56.103. 1) enable named. conf, add the following content # vi named. conf [plain] key "rndc-key" {algorithm HMAC-MD5; secret "kMOStrdGYC5WmE1obk7LJg =" ;}; controls {inet 127.0.0.1 Port 953 allow {127.0.0.1;} keys {"rndc-key" ;};}; options {directory "/var/named "; pid-file "/var/run/named. pid "; allow-query {any ;}; recursion no ;}; zone ". "IN {type hint; file" db. root ";}; zone" com. "IN {type master; file" db.com ";}; Where: recursion no; disables recursive queries. 2) create a zone configuration file # cd/var # mkdir named # cd named # touch db. root # vi db. root [plain] $ TTL 86000 @ in soa @ root (1 1 m 1 m 1 m 1 m ). in ns root. ns. root. ns. in a 192.168.56.101 com. in ns ns.com. ns.com. in a 192.168.56.103 Where: com. in ns ns.com. authorization is required. Otherwise, the address similar to My.com cannot be found in recursive parsing. same as root # vi db.com [plain] $ TTL 86400 @ in soa @ root (2 1 m 1 m 1 m 1 m) com. in ns ns.com. ns.com. in a 192.168. 56.103 my.com. in a 192.168.56.201 3) start BIND and test # cd/usr/local/named # sbin/named-g & # dig @ 192.168.56.103 com. NS [plain] root @ simba-2:/usr/local/named/etc # dig @ 192.168.56.103 com. NS; <> DiG 9.9.2-P1 <> @ 192.168.56.103 com. NS; (1 server found); global options: + cmd; Got answer :;;>> HEADER <-opcode: QUERY, status: NOERROR, id: 19097; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORI TY: 0, ADDITIONAL: 2; WARNING: recursion requested but not available; OPT pseudo SECTION:; EDNS: version: 0, flags:; udp: 4096; question section :; com. in ns; answer section: com. 86400 in ns ns.com .;; additional section: ns.com. 86400 in a 192.168.56.103; Query time: 21 msec; SERVER: 192.168.56.103 #53 (192.168.56.103); WHEN: Wed Aug 21 07:45:15 2013; msg size rcvd: 65 # dig @192.1 68.56.103 my.com. A [plain] root @ simba-2:/usr/local/named/etc # dig @ 192.168.56.103 my.com. a; <> DiG 9.9.2-P1 <> @ 192.168.56.103 my.com. a; (1 server found); global options: + cmd; Got answer :;;>> HEADER <-opcode: QUERY, status: NOERROR, id: 23466; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 2; WARNING: recursion requested but not available; OPT pseudo section :; EDNS: version: 0, flags:; udp: 4096; question section:; my.com. in a; answer section: my.com. 86400 in a 192.168.56.201; authority section: com. 86400 in ns ns.com .;; additional section: ns.com. 86400 in a 192.168.56.103; Query time: 17 msec; SERVER: 192.168.56.103 #53 (192.168.56.103); WHEN: Wed Aug 21 07:46:41 2013; msg size rcvd: 84 6. configure the DNS server on 192.168.56.104. 1) enable named. conf, Add the following content # vi named. conf [plain] key "rndc-key" {algorithm HMAC-MD5; secret "kMOStrdGYC5WmE1obk7LJg =" ;}; controls {inet 127.0.0.1 port 953 allow {127.0.0.1 ;} keys {"rndc-key" ;};}; options {directory "/var/named"; pid-file "/var/run/named. pid "; allow-query {any ;}; recursion yes; allow-recursion {any ;}; zone ". "IN {type hint; file" db. root ";}; Where: recursion yes; enables recursive queries. Allow-recursion {any ;}; is another method for enabling recursive queries. 2) create a zone configuration file # cd/var # mkdir named # cd named # touch db. root # vi db. root [plain] $ TTL 8600 @ in soa @ root (1 1 m 1 m 1 m 1 m ). in ns root. ns. root. ns. in a 192.168.56.101: here, you only need to give the root NS and A record. 3) start BIND and test # cd/usr/local/named # sbin/named-g & Dig send recursive query # dig @ 192.168.56.104 com by default. SOA [plain] root @ simba-2:/usr/local/named/etc # dig @ 192.168.56.104 com. SOA; <> DiG 9.9.2-P1 <> @ 192.168.56.104 com. SOA; (1 server found); global options: + cmd; Got answer :;;>> HEADER <-opcode: QUERY, status: NOERROR, id: 44824; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 2; OPT pseudo section:; EDNS: version: 0, flags :; udp: 4096; question section:; com. in soa; answer section: com. 86358 in soa com. root.com. 2 60 60 60 60; authority section: com. 86354 in ns ns.com .;; additional section: ns.com. 86354 in a 192.168.56.103; Query time: 16 msec; SERVER: 192.168.56.104 #53 (192.168.56.104); WHEN: Wed Aug 21 07:52:46 2013; msg size rcvd: 106 as you can see; flags: qr rd ra; there is no aa here, indicating that the query is not authoritative # dig @ 192.168.56.104 my.com. A [plain] root @ simba-2:/usr/local/named/etc # dig @ 192.168.56.104 my.com. a; <> DiG 9.9.2-P1 <> @ 192.168.56.104 my.com. a; (1 server found); global options: + cmd; Got answer :;;>> HEADER <-opcode: QUERY, status: NOERROR, id: 21228; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 2; OPT pseudo section:; EDNS: version: 0, flags :; udp: 4096; question section:; my.com. in a; answer section: my.com. 86286 in a 192.168.56.201; authority section: com. 86259 in ns ns.com .;; additional section: ns.com. 86259 in a 192.168.56.103; Query time: 15 msec; SERVER: 192.168.56.104 #53 (192.168.56.104); WHEN: Wed Aug 21 07:54:21 2013; msg size rcvd: 84
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