· 7 years ago · Apr 03, 2018, 05:16 PM
1include "/etc/bind/named.conf.options";
2include "/etc/bind/named.conf.local";
3include "/etc/bind/named.conf.default-zones";
4
5logging {
6 channel query.log {
7 file "/var/log/query.log"; severity debug 3;
8 };
9 category queries { query.log; };
10};
11
12zone "nlab.local" {
13 type master;
14 file "/etc/bind/db.nlab.local";
15 };
16
17zone "1.168.192.in-addr.arpa" {
18 type master;
19 notify no;
20 file "/etc/bind/db.192";
21};
22
23options {
24 directory "/var/cache/bind";
25
26 // If there is a firewall between you and nameservers you want
27 // to talk to, you may need to fix the firewall to allow multiple
28 // ports to talk. See http://www.kb.cert.org/vuls/id/800113
29
30 // If your ISP provided one or more IP addresses for stable
31 // nameservers, you probably want to use them as forwarders.
32 // Uncomment the following block, and insert the addresses replacing
33 // the all-0's placeholder.
34
35 // forwarders {
36 // 0.0.0.0;
37 // };
38
39 //========================================================================
40 // If BIND logs error messages about the root key being expired,
41 // you will need to update your keys. See https://www.isc.org/bind-keys
42 //========================================================================
43 dnssec-validation auto;
44
45 auth-nxdomain no; # conform to RFC1035
46 listen-on-v6 { any; };
47 allow-query { any; };
48
49};
50
51;
52; BIND data file for nlab.local
53;
54$TTL 604800
55@ IN SOA ns.nlab.local. ike.nlab.local. (
56 11 ; Serial
57 604800 ; Refresh
58 86400 ; Retry
59 2419200 ; Expire
60 604800 ) ; Negative Cache TTL
61;
62@ IN NS ns.nlab.local.
63@ IN A 192.168.1.2
64@ IN AAAA ::1
65ns IN A 192.168.1.2
66ns1 IN A 192.168.1.12
67nc1 IN A 192.168.1.9
68nightfall IN CNAME ns
69freefall IN CNAME nc1
70
71;
72; BIND reverse data file for local loopback interface
73;
74$TTL 604800
75@ IN SOA ns.nlab.local. root.nlab.local. (
76 5 ; Serial
77 604800 ; Refresh
78 86400 ; Retry
79 2419200 ; Expire
80 604800 ) ; Negative Cache TTL
81;
82@ IN NS ns.
832 IN PTR ns.nlab.local.
84
85; also list other computers
8612 IN PTR ns1.nlab.local.
879 IN PTR nc1.nlab.local.
88
89tcp 0 0 127.0.1.1:53 0.0.0.0:* LISTEN 9324/dnsmasq
90tcp 0 0 192.168.1.2:53 0.0.0.0:* LISTEN 1540/named
91tcp 0 0 172.17.0.1:53 0.0.0.0:* LISTEN 1540/named
92tcp 0 0 127.0.0.1:53 0.0.0.0:* LISTEN 1540/named
93tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1531/sshd
94tcp 0 0 127.0.0.1:953 0.0.0.0:* LISTEN 1540/named
95tcp 0 0 192.168.1.2:51444 34.211.99.53:443 TIME_WAIT -
96tcp 0 0 192.168.1.2:44613 192.52.178.30:53 TIME_WAIT -
97tcp 32 0 192.168.1.2:54530 162.125.5.3:443 CLOSE_WAIT 2976/dropbox
98tcp 0 0 192.168.1.2:41171 192.12.94.30:53 TIME_WAIT -
99tcp 1 0 192.168.1.2:53664 54.236.121.227:443 CLOSE_WAIT 2976/dropbox
100tcp6 0 0 :::22 :::* LISTEN 1531/sshd
101udp 0 0 127.0.0.1:60178 127.0.0.1:53 ESTABLISHED 2372/Plex DLNA Serv
102udp 0 0 0.0.0.0:5353 0.0.0.0:* 1285/avahi-daemon:
103udp 0 0 127.0.0.1:46562 127.0.0.1:53 ESTABLISHED 2372/Plex DLNA Serv
104udp 0 0 127.0.0.1:38551 127.0.0.1:53 ESTABLISHED 3715/plugin_host
105udp 0 0 127.0.1.1:53 0.0.0.0:* 9324/dnsmasq
106udp 0 0 192.168.1.2:53 0.0.0.0:* 1540/named
107udp 0 0 172.17.0.1:53 0.0.0.0:* 1540/named
108udp 0 0 127.0.0.1:53 0.0.0.0:* 1540/named
109udp6 0 0 :::5353 :::* 1285/avahi-daemon:
110
111$ host nlab.local
112nlab.local has address 192.168.1.2
113
114$ host ns1.nlab.local
115ns1.nlab.local has address 192.168.1.12
116
117$ ping nlab.local
118ping: unknown host nlab.local
119
120$ ping ns1.nlab.local
121ping: unknown host ns1.nlab.local
122
123$ dig nlab.local
124
125; <<>> DiG 9.10.3-P4-Ubuntu <<>> nlab.local
126;; global options: +cmd
127;; Got answer:
128;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 61277
129;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 2
130
131;; OPT PSEUDOSECTION:
132; EDNS: version: 0, flags:; udp: 4096
133;; QUESTION SECTION:
134;nlab.local. IN A
135
136;; ANSWER SECTION:
137nlab.local. 604800 IN A 192.168.1.2
138
139;; AUTHORITY SECTION:
140nlab.local. 604800 IN NS ns.nlab.local.
141
142;; ADDITIONAL SECTION:
143ns.nlab.local. 604800 IN A 192.168.1.2
144
145;; Query time: 0 msec
146;; SERVER: 127.0.0.1#53(127.0.0.1)
147;; WHEN: Tue Apr 03 12:50:55 EDT 2018
148;; MSG SIZE rcvd: 88
149
150$ dig nlab.local
151
152; <<>> DiG 9.10.3-P4-Ubuntu <<>> nlab.local
153;; global options: +cmd
154;; Got answer:
155;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 24440
156;; flags: qr rd ra ad; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 0
157
158;; QUESTION SECTION:
159;nlab.local. IN A
160
161;; Query time: 0 msec
162;; SERVER: 127.0.0.1#53(127.0.0.1)
163;; WHEN: Tue Apr 03 12:59:11 EDT 2018
164;; MSG SIZE rcvd: 28
165
166source /etc/network/interfaces.d/*
167
168# The loopback network interface
169auto lo
170iface lo inet loopback
171
172# The primary network interface
173auto enp0s3
174iface enp0s3 inet static
175address 192.168.1.12
176netmask 255.255.255.0
177gateway 192.168.1.1
178dns-nameservers 192.168.1.2 8.8.8.8 75.75.75.75