实验内容

IP 地址是与服务器内容没有关联的一串数字,不便于记忆,通过 DNS 可以帮助我们将这些无意义、难以记忆的数字与有意义的描述做关联,帮助我们记忆,本实验便将带领大家搭建自己的 DNS 服务器。

实验知识点

  • DNS 简介
  • DNS 解析
  • DNS 搭建
  • DNS 验证

推荐阅读

 

DNS 是 Domain Name System(域名系统)的简称,DNS 是一个分层的分布式命名系统,用于连接到互联网或专用网络的计算机,服务或其他资源。它将各种信息与分配给每个参与实体的域名关联起来。

简单来说其最大的功能就是将域名翻译成 IP 地址

 

人的姓名是由姓氏与名字构成的,同样域名也是由多个部分构成的。构成域名的每个部分称为一个区域(zone),主要是这样分级的:主机名.二级域名.顶级域名.

 

www.baiidu.com

www 主机名,三级域名

baidu 二级域名

com 顶级域名

 

在 Linux 中我们可以通过 /etc/nsswitch.conf 配置文件修改 DNS 查询的顺序。

通过 sudo vim /etc/nsswitch.conf 打开该配置文件,往下查看就可以看到这样的配置:

 

hosts: files mdns4_minimal [NOTFOUND=return] dns

 

这里的 files 代表的就是 /etc/hosts 文件,dns 代表的是系统配置的 DNS 服务器地址。所以在 Linux 中默认是先查询 hosts 文件中的记录,然后再请求 DNS 服务器

 

 

cat /etc/hosts

0.0.0.0 account.jetbrains.com

ip 域名

 

DNS 服务器配置文件

系统设定的 DNS 服务器配置文件位于 /etc/resolv.conf

nameserver 114.114.114.114
nameserver 8.8.8.8
nameserver 127.0.0.53

 

dns选用

DNS 的使用方案有许多,常见的开源软件有:

  • BIND:全名为 Berkeley Internet Name Domain,是早在 1980 年左右有 Berkeley 大学公开出来的 DNS 服务实现,也是使用最为广泛的方案。后由 ISC 基于 BIND 重写发布 BIND9

  • PowerDNS:PowerDNS 由 C++ 实现于 1990 年末,起源一个商业软件于 2002 年开源,相对于 BIND 在数据库选用上与集群上功能更多更灵活

  • CoreDNS:由 SkyDNS 进化而来,主要作为一种可插拔的中间件

  • DNSpod-sr:一款由国内服务商开源的一套 DNS 的实现

此次我们将选用最为成熟、拥有良好 License 的 BIND9 来搭建属于我们自己的 DNS 服务器。

 

 

bind9安装

 

 

shiyanlou:~/ $ cat /etc/apt/sources.list [16:35:31]
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://mirrors.cloud.aliyuncs.com/ubuntu/ xenial main restricted
# deb-src http://mirrors.cloud.aliyuncs.com/ubuntu/ xenial main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://mirrors.cloud.aliyuncs.com/ubuntu/ xenial-updates main restricted
# deb-src http://mirrors.cloud.aliyuncs.com/ubuntu/ xenial-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://mirrors.cloud.aliyuncs.com/ubuntu/ xenial universe
# deb-src http://mirrors.cloud.aliyuncs.com/ubuntu/ xenial universe
deb http://mirrors.cloud.aliyuncs.com/ubuntu/ xenial-updates universe
# deb-src http://mirrors.cloud.aliyuncs.com/ubuntu/ xenial-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://mirrors.cloud.aliyuncs.com/ubuntu/ xenial multiverse
# deb-src http://mirrors.cloud.aliyuncs.com/ubuntu/ xenial multiverse
deb http://mirrors.cloud.aliyuncs.com/ubuntu/ xenial-updates multiverse
# deb-src http://mirrors.cloud.aliyuncs.com/ubuntu/ xenial-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://mirrors.cloud.aliyuncs.com/ubuntu/ xenial-backports main restricted universe multiverse
# deb-src http://mirrors.cloud.aliyuncs.com/ubuntu/ xenial-backports main restricted universe multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu xenial partner
# deb-src http://archive.canonical.com/ubuntu xenial partner

deb http://mirrors.cloud.aliyuncs.com/ubuntu/ xenial-security main restricted
# deb-src http://mirrors.cloud.aliyuncs.com/ubuntu/ xenial-security main restricted
deb http://mirrors.cloud.aliyuncs.com/ubuntu/ xenial-security universe
# deb-src http://mirrors.cloud.aliyuncs.com/ubuntu/ xenial-security universe
deb http://mirrors.cloud.aliyuncs.com/ubuntu/ xenial-security multiverse
# deb-src http://mirrors.cloud.aliyuncs.com/ubuntu/ xenial-security multiverse
shiyanlou:~/ $ cat /etc/issue [16:35:46]
Ubuntu 16.04.7 LTS \n \l

shiyanlou:~/ $ sudo apt -y intall bind9 bind9utils bind9-doc [16:35:54]
E: \u4e0d\u80fd\u7406\u89e3\u547d\u4ee4\u884c\u9009\u9879 \u201cy\u201d [\u6765\u81ea -y] \u4e0e\u5176\u4ed6\u9009\u9879\u7684\u642d\u914d\u3002
shiyanlou:~/ $ sudo apt -y install bind9 bind9utils bind9-doc [16:36:34]
\u6b63\u5728\u8bfb\u53d6\u8f6f\u4ef6\u5305\u5217\u8868... \u5b8c\u6210
\u6b63\u5728\u5206\u6790\u8f6f\u4ef6\u5305\u7684\u4f9d\u8d56\u5173\u7cfb\u6811
\u6b63\u5728\u8bfb\u53d6\u72b6\u6001\u4fe1\u606f... \u5b8c\u6210
\u5c06\u4f1a\u540c\u65f6\u5b89\u88c5\u4e0b\u5217\u8f6f\u4ef6\uff1a
libirs141
\u5efa\u8bae\u5b89\u88c5\uff1a
resolvconf ufw
\u4e0b\u5217\u3010\u65b0\u3011\u8f6f\u4ef6\u5305\u5c06\u88ab\u5b89\u88c5\uff1a
bind9 bind9-doc bind9utils libirs141
\u5347\u7ea7\u4e86 0 \u4e2a\u8f6f\u4ef6\u5305\uff0c\u65b0\u5b89\u88c5\u4e86 4 \u4e2a\u8f6f\u4ef6\u5305\uff0c\u8981\u5378\u8f7d 0 \u4e2a\u8f6f\u4ef6\u5305\uff0c\u6709 0 \u4e2a\u8f6f\u4ef6\u5305\u672a\u88ab\u5347\u7ea7\u3002
\u9700\u8981\u4e0b\u8f7d 790 kB \u7684\u5f52\u6863\u3002
\u89e3\u538b\u7f29\u540e\u4f1a\u6d88\u8017 4,538 kB \u7684\u989d\u5916\u7a7a\u95f4\u3002
\u83b7\u53d6:1 http://mirrors.cloud.aliyuncs.com/ubuntu xenial-updates/main amd64 libirs141 amd64 1:9.10.3.dfsg.P4-8ubuntu1.17 [18.0 kB]
\u83b7\u53d6:2 http://mirrors.cloud.aliyuncs.com/ubuntu xenial-updates/main amd64 bind9utils amd64 1:9.10.3.dfsg.P4-8ubuntu1.17 [201 kB]
\u83b7\u53d6:3 http://mirrors.cloud.aliyuncs.com/ubuntu xenial-updates/main amd64 bind9 amd64 1:9.10.3.dfsg.P4-8ubuntu1.17 [373 kB]
\u83b7\u53d6:4 http://mirrors.cloud.aliyuncs.com/ubuntu xenial-updates/main amd64 bind9-doc all 1:9.10.3.dfsg.P4-8ubuntu1.17 [199 kB]
\u5df2\u4e0b\u8f7d 790 kB\uff0c\u8017\u65f6 0\u79d2 (5,267 kB/s)
\u6b63\u5728\u9884\u8bbe\u5b9a\u8f6f\u4ef6\u5305 ...
\u6b63\u5728\u9009\u4e2d\u672a\u9009\u62e9\u7684\u8f6f\u4ef6\u5305 libirs141:amd64\u3002
(\u6b63\u5728\u8bfb\u53d6\u6570\u636e\u5e93 ... \u7cfb\u7edf\u5f53\u524d\u5171\u5b89\u88c5\u6709 136529 \u4e2a\u6587\u4ef6\u548c\u76ee\u5f55\u3002)
\u6b63\u51c6\u5907\u89e3\u5305 .../libirs141_1%3a9.10.3.dfsg.P4-8ubuntu1.17_amd64.deb ...
\u6b63\u5728\u89e3\u5305 libirs141:amd64 (1:9.10.3.dfsg.P4-8ubuntu1.17) ...
\u6b63\u5728\u9009\u4e2d\u672a\u9009\u62e9\u7684\u8f6f\u4ef6\u5305 bind9utils\u3002
\u6b63\u51c6\u5907\u89e3\u5305 .../bind9utils_1%3a9.10.3.dfsg.P4-8ubuntu1.17_amd64.deb ...
\u6b63\u5728\u89e3\u5305 bind9utils (1:9.10.3.dfsg.P4-8ubuntu1.17) ...
\u6b63\u5728\u9009\u4e2d\u672a\u9009\u62e9\u7684\u8f6f\u4ef6\u5305 bind9\u3002
\u6b63\u51c6\u5907\u89e3\u5305 .../bind9_1%3a9.10.3.dfsg.P4-8ubuntu1.17_amd64.deb ...
\u6b63\u5728\u89e3\u5305 bind9 (1:9.10.3.dfsg.P4-8ubuntu1.17) ...
\u6b63\u5728\u9009\u4e2d\u672a\u9009\u62e9\u7684\u8f6f\u4ef6\u5305 bind9-doc\u3002
\u6b63\u51c6\u5907\u89e3\u5305 .../bind9-doc_1%3a9.10.3.dfsg.P4-8ubuntu1.17_all.deb ...
\u6b63\u5728\u89e3\u5305 bind9-doc (1:9.10.3.dfsg.P4-8ubuntu1.17) ...
\u6b63\u5728\u5904\u7406\u7528\u4e8e libc-bin (2.23-0ubuntu11.2) \u7684\u89e6\u53d1\u5668 ...
\u6b63\u5728\u5904\u7406\u7528\u4e8e man-db (2.7.5-1) \u7684\u89e6\u53d1\u5668 ...
\u6b63\u5728\u5904\u7406\u7528\u4e8e systemd (229-4ubuntu21.29) \u7684\u89e6\u53d1\u5668 ...
\u6b63\u5728\u8bbe\u7f6e libirs141:amd64 (1:9.10.3.dfsg.P4-8ubuntu1.17) ...
\u6b63\u5728\u8bbe\u7f6e bind9utils (1:9.10.3.dfsg.P4-8ubuntu1.17) ...
\u6b63\u5728\u8bbe\u7f6e bind9 (1:9.10.3.dfsg.P4-8ubuntu1.17) ...
\u6b63\u5728\u6dfb\u52a0\u7ec4"bind" (GID 120)...
\u5b8c\u6210\u3002
\u6b63\u5728\u6dfb\u52a0\u7cfb\u7edf\u7528\u6237"bind" (UID 114)...
\u6b63\u5728\u5c06\u65b0\u7528\u6237"bind" (UID 114)\u6dfb\u52a0\u5230\u7ec4"bind"...
\u65e0\u6cd5\u521b\u5efa\u4e3b\u76ee\u5f55"/var/cache/bind"
wrote key file "/etc/bind/rndc.key"
#
invoke-rc.d: could not determine current runlevel
invoke-rc.d: policy-rc.d denied execution of start.
\u6b63\u5728\u8bbe\u7f6e bind9-doc (1:9.10.3.dfsg.P4-8ubuntu1.17) ...
\u6b63\u5728\u5904\u7406\u7528\u4e8e libc-bin (2.23-0ubuntu11.2) \u7684\u89e6\u53d1\u5668 ...
\u6b63\u5728\u5904\u7406\u7528\u4e8e systemd (229-4ubuntu21.29) \u7684\u89e6\u53d1\u5668 ...
shiyanlou:~/ $ sudo vi /etc/default/bind9 [16:36:47]
shiyanlou:~/ $ ifconfig -a [16:37:18]
eth0 Link encap:\u4ee5\u592a\u7f51 \u786c\u4ef6\u5730\u5740 02:42:c0:a8:2a:05
inet \u5730\u5740:192.168.42.5 \u5e7f\u64ad:192.168.42.255 \u63a9\u7801:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 \u8dc3\u70b9\u6570:1
\u63a5\u6536\u6570\u636e\u5305:2002 \u9519\u8bef:0 \u4e22\u5f03:0 \u8fc7\u8f7d:0 \u5e27\u6570:0
\u53d1\u9001\u6570\u636e\u5305:2266 \u9519\u8bef:0 \u4e22\u5f03:0 \u8fc7\u8f7d:0 \u8f7d\u6ce2:0
\u78b0\u649e:0 \u53d1\u9001\u961f\u5217\u957f\u5ea6:0
\u63a5\u6536\u5b57\u8282:934310 (934.3 KB) \u53d1\u9001\u5b57\u8282:4823392 (4.8 MB)

lo Link encap:\u672c\u5730\u73af\u56de
inet \u5730\u5740:127.0.0.1 \u63a9\u7801:255.0.0.0
UP LOOPBACK RUNNING MTU:65536 \u8dc3\u70b9\u6570:1
\u63a5\u6536\u6570\u636e\u5305:0 \u9519\u8bef:0 \u4e22\u5f03:0 \u8fc7\u8f7d:0 \u5e27\u6570:0
\u53d1\u9001\u6570\u636e\u5305:0 \u9519\u8bef:0 \u4e22\u5f03:0 \u8fc7\u8f7d:0 \u8f7d\u6ce2:0
\u78b0\u649e:0 \u53d1\u9001\u961f\u5217\u957f\u5ea6:1000
\u63a5\u6536\u5b57\u8282:0 (0.0 B) \u53d1\u9001\u5b57\u8282:0 (0.0 B)

shiyanlou:~/ $ ping -c 3 192.168.42.1 [16:37:22]
PING 192.168.42.1 (192.168.42.1) 56(84) bytes of data.
64 bytes from 192.168.42.1: icmp_seq=1 ttl=64 time=0.072 ms
64 bytes from 192.168.42.1: icmp_seq=2 ttl=64 time=0.049 ms
64 bytes from 192.168.42.1: icmp_seq=3 ttl=64 time=0.050 ms

--- 192.168.42.1 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2055ms
rtt min/avg/max/mdev = 0.049/0.057/0.072/0.010 ms
shiyanlou:~/ $ cat /etc/bind/named.conf [16:38:10]
// This is the primary configuration file for the BIND DNS server named.
//
// Please read /usr/share/doc/bind9/README.Debian.gz for information on the
// structure of BIND configuration files in Debian, *BEFORE* you customize
// this configuration file.
//
// If you are just adding zones, please do that in /etc/bind/named.conf.local

include "/etc/bind/named.conf.options";
include "/etc/bind/named.conf.local";
include "/etc/bind/named.conf.default-zones";
shiyanlou:~/ $ sudo vi /etc/bind/named.conf.options [16:38:32]
shiyanlou:~/ $ sudo vi /etc/bind/named.conf.options [16:43:23]
shiyanlou:~/ $ sudo vi /etc/bind/named.conf.local [16:46:38]
shiyanlou:~/ $ sudo mkdir /etc/bind/zones [16:49:14]
shiyanlou:~/ $ sudo cp /etc/bind/db.local /etc/bind/zones/db.shiyanlou.example.com
shiyanlou:~/ $ sudo vi /etc/bind/zones/db.shiyanlou.example.com [16:50:40]
shiyanlou:~/ $ sudo cp /etc/bind/db.127 /etc/bind/zones/db.192.168 [16:54:00]
shiyanlou:~/ $ sudo vi $ [16:54:28]
shiyanlou:~/ $ sudo vi /etc/bind/zones/db.192.168 [16:54:35]
shiyanlou:~/ $ sudo named-checkconf [16:58:04]
/etc/bind/named.conf.options:6: missing ';' before 'options'
/etc/bind/named.conf:11: missing ';' before 'include'
shiyanlou:~/ $ sudo vim /etc/bind/named.conf.options [16:58:47]
shiyanlou:~/ $ sudo named-checkconf [16:59:16]
/etc/bind/named.conf:11: missing ';' before 'include'
shiyanlou:~/ $ sudo vim /etc/bind/named.conf [16:59:18]
shiyanlou:~/ $ sudo vim /etc/bind/named.conf [16:59:47]
shiyanlou:~/ $ sudo vim /etc/bind/named.conf [17:00:00]
shiyanlou:~/ $ sudo vim /etc/bind/named.conf.local [17:00:16]
shiyanlou:~/ $ sudo named-checkconf [17:00:28]
shiyanlou:~/ $ sudo serviice bind9 restart [17:00:30]
sudo: serviice\uff1a\u627e\u4e0d\u5230\u547d\u4ee4
shiyanlou:~/ $ sudo service bind9 restart [17:00:39]
* Stopping domain name service... bind9 rndc: connect failed: 127.0.0.1#953: connection refused
[ OK ]
* Starting domain name service... bind9 [ OK ]
shiyanlou:~/ $ sudo service bind9 status [17:00:45]
* bind9 is running
shiyanlou:~/ $ sudo vi /etc/resolv.conf [17:00:52]
shiyanlou:~/ $ sudo named -g [17:01:32]
09-Feb-2021 17:01:42.800 starting BIND 9.10.3-P4-Ubuntu <id:ebd72b3> -g
09-Feb-2021 17:01:42.800 built with '--prefix=/usr' '--mandir=/usr/share/man' '--libdir=/usr/lib/x86_64-linux-gnu' '--infodir=/usr/share/info' '--sysconfdir=/etc/bind' '--localstatedir=/' '--enable-threads' '--enable-largefile' '--with-libtool' '--enable-shared' '--enable-static' '--with-openssl=/usr' '--with-gssapi=/usr' '--with-gnu-ld' '--with-geoip=/usr' '--with-atf=no' '--enable-ipv6' '--enable-rrl' '--enable-filter-aaaa' '--enable-native-pkcs11' '--with-pkcs11=/usr/lib/x86_64-linux-gnu/softhsm/libsofthsm2.so' 'CFLAGS=-g -O2 -fPIE -fstack-protector-strong -Wformat -Werror=format-security -fno-strict-aliasing -fno-delete-null-pointer-checks -DNO_VERSION_DATE' 'LDFLAGS=-Wl,-Bsymbolic-functions -fPIE -pie -Wl,-z,relro -Wl,-z,now' 'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2 -DDIG_SIGCHASE'
09-Feb-2021 17:01:42.800 ----------------------------------------------------
09-Feb-2021 17:01:42.800 BIND 9 is maintained by Internet Systems Consortium,
09-Feb-2021 17:01:42.801 Inc. (ISC), a non-profit 501(c)(3) public-benefit
09-Feb-2021 17:01:42.801 corporation. Support and training for BIND 9 are
09-Feb-2021 17:01:42.801 available at https://www.isc.org/support
09-Feb-2021 17:01:42.801 ----------------------------------------------------
09-Feb-2021 17:01:42.801 found 4 CPUs, using 4 worker threads
09-Feb-2021 17:01:42.801 using 2 UDP listeners per interface
09-Feb-2021 17:01:42.801 using up to 4096 sockets
09-Feb-2021 17:01:42.805 loading configuration from '/etc/bind/named.conf'
09-Feb-2021 17:01:42.806 reading built-in trusted keys from file '/etc/bind/bind.keys'
09-Feb-2021 17:01:42.806 initializing GeoIP Country (IPv4) (type 1) DB
09-Feb-2021 17:01:42.806 GEO-106FREE 20160408 Bu
09-Feb-2021 17:01:42.806 initializing GeoIP Country (IPv6) (type 12) DB
09-Feb-2021 17:01:42.806 GEO-106FREE 20160408 Bu
09-Feb-2021 17:01:42.806 GeoIP City (IPv4) (type 2) DB not available
09-Feb-2021 17:01:42.806 GeoIP City (IPv4) (type 6) DB not available
09-Feb-2021 17:01:42.806 GeoIP City (IPv6) (type 30) DB not available
09-Feb-2021 17:01:42.806 GeoIP City (IPv6) (type 31) DB not available
09-Feb-2021 17:01:42.806 GeoIP Region (type 3) DB not available
09-Feb-2021 17:01:42.806 GeoIP Region (type 7) DB not available
09-Feb-2021 17:01:42.806 GeoIP ISP (type 4) DB not available
09-Feb-2021 17:01:42.806 GeoIP Org (type 5) DB not available
09-Feb-2021 17:01:42.806 GeoIP AS (type 9) DB not available
09-Feb-2021 17:01:42.806 GeoIP Domain (type 11) DB not available
09-Feb-2021 17:01:42.806 GeoIP NetSpeed (type 10) DB not available
09-Feb-2021 17:01:42.806 using default UDP/IPv4 port range: [32768, 60999]
09-Feb-2021 17:01:42.806 using default UDP/IPv6 port range: [32768, 60999]
09-Feb-2021 17:01:42.807 listening on IPv6 interfaces, port 53
09-Feb-2021 17:01:42.830 listening on IPv4 interface eth0, 192.168.42.5#53
09-Feb-2021 17:01:42.831 binding TCP socket: address in use
09-Feb-2021 17:01:42.831 generating session key for dynamic DNS
09-Feb-2021 17:01:42.831 sizing zone task pool based on 7 zones
09-Feb-2021 17:01:42.835 using built-in root key for view _default
09-Feb-2021 17:01:42.835 set up managed keys zone for view _default, file 'managed-keys.bind'
09-Feb-2021 17:01:42.835 automatic empty zone: 10.IN-ADDR.ARPA
09-Feb-2021 17:01:42.835 automatic empty zone: 16.172.IN-ADDR.ARPA
09-Feb-2021 17:01:42.835 automatic empty zone: 17.172.IN-ADDR.ARPA
09-Feb-2021 17:01:42.835 automatic empty zone: 18.172.IN-ADDR.ARPA
09-Feb-2021 17:01:42.835 automatic empty zone: 19.172.IN-ADDR.ARPA
09-Feb-2021 17:01:42.835 automatic empty zone: 20.172.IN-ADDR.ARPA
09-Feb-2021 17:01:42.835 automatic empty zone: 21.172.IN-ADDR.ARPA
09-Feb-2021 17:01:42.835 automatic empty zone: 22.172.IN-ADDR.ARPA
09-Feb-2021 17:01:42.835 automatic empty zone: 23.172.IN-ADDR.ARPA
09-Feb-2021 17:01:42.835 automatic empty zone: 24.172.IN-ADDR.ARPA
09-Feb-2021 17:01:42.835 automatic empty zone: 25.172.IN-ADDR.ARPA
09-Feb-2021 17:01:42.835 automatic empty zone: 26.172.IN-ADDR.ARPA
09-Feb-2021 17:01:42.835 automatic empty zone: 27.172.IN-ADDR.ARPA
09-Feb-2021 17:01:42.835 automatic empty zone: 28.172.IN-ADDR.ARPA
09-Feb-2021 17:01:42.836 automatic empty zone: 29.172.IN-ADDR.ARPA
09-Feb-2021 17:01:42.836 automatic empty zone: 30.172.IN-ADDR.ARPA
09-Feb-2021 17:01:42.836 automatic empty zone: 31.172.IN-ADDR.ARPA
09-Feb-2021 17:01:42.836 automatic empty zone: 64.100.IN-ADDR.ARPA
09-Feb-2021 17:01:42.836 automatic empty zone: 65.100.IN-ADDR.ARPA
09-Feb-2021 17:01:42.836 automatic empty zone: 66.100.IN-ADDR.ARPA
09-Feb-2021 17:01:42.836 automatic empty zone: 67.100.IN-ADDR.ARPA
09-Feb-2021 17:01:42.836 automatic empty zone: 68.100.IN-ADDR.ARPA
09-Feb-2021 17:01:42.836 automatic empty zone: 69.100.IN-ADDR.ARPA
09-Feb-2021 17:01:42.836 automatic empty zone: 70.100.IN-ADDR.ARPA
09-Feb-2021 17:01:42.836 automatic empty zone: 71.100.IN-ADDR.ARPA
09-Feb-2021 17:01:42.836 automatic empty zone: 72.100.IN-ADDR.ARPA
09-Feb-2021 17:01:42.836 automatic empty zone: 73.100.IN-ADDR.ARPA
09-Feb-2021 17:01:42.836 automatic empty zone: 74.100.IN-ADDR.ARPA
09-Feb-2021 17:01:42.836 automatic empty zone: 75.100.IN-ADDR.ARPA
09-Feb-2021 17:01:42.836 automatic empty zone: 76.100.IN-ADDR.ARPA
09-Feb-2021 17:01:42.836 automatic empty zone: 77.100.IN-ADDR.ARPA
09-Feb-2021 17:01:42.836 automatic empty zone: 78.100.IN-ADDR.ARPA
09-Feb-2021 17:01:42.836 automatic empty zone: 79.100.IN-ADDR.ARPA
09-Feb-2021 17:01:42.836 automatic empty zone: 80.100.IN-ADDR.ARPA
09-Feb-2021 17:01:42.836 automatic empty zone: 81.100.IN-ADDR.ARPA
09-Feb-2021 17:01:42.836 automatic empty zone: 82.100.IN-ADDR.ARPA
09-Feb-2021 17:01:42.836 automatic empty zone: 83.100.IN-ADDR.ARPA
09-Feb-2021 17:01:42.836 automatic empty zone: 84.100.IN-ADDR.ARPA
09-Feb-2021 17:01:42.836 automatic empty zone: 85.100.IN-ADDR.ARPA
09-Feb-2021 17:01:42.836 automatic empty zone: 86.100.IN-ADDR.ARPA
09-Feb-2021 17:01:42.836 automatic empty zone: 87.100.IN-ADDR.ARPA
09-Feb-2021 17:01:42.836 automatic empty zone: 88.100.IN-ADDR.ARPA
09-Feb-2021 17:01:42.836 automatic empty zone: 89.100.IN-ADDR.ARPA
09-Feb-2021 17:01:42.836 automatic empty zone: 90.100.IN-ADDR.ARPA
09-Feb-2021 17:01:42.836 automatic empty zone: 91.100.IN-ADDR.ARPA
09-Feb-2021 17:01:42.836 automatic empty zone: 92.100.IN-ADDR.ARPA
09-Feb-2021 17:01:42.836 automatic empty zone: 93.100.IN-ADDR.ARPA
09-Feb-2021 17:01:42.836 automatic empty zone: 94.100.IN-ADDR.ARPA
09-Feb-2021 17:01:42.836 automatic empty zone: 95.100.IN-ADDR.ARPA
09-Feb-2021 17:01:42.836 automatic empty zone: 96.100.IN-ADDR.ARPA
09-Feb-2021 17:01:42.836 automatic empty zone: 97.100.IN-ADDR.ARPA
09-Feb-2021 17:01:42.836 automatic empty zone: 98.100.IN-ADDR.ARPA
09-Feb-2021 17:01:42.837 automatic empty zone: 99.100.IN-ADDR.ARPA
09-Feb-2021 17:01:42.837 automatic empty zone: 100.100.IN-ADDR.ARPA
09-Feb-2021 17:01:42.837 automatic empty zone: 101.100.IN-ADDR.ARPA
09-Feb-2021 17:01:42.837 automatic empty zone: 102.100.IN-ADDR.ARPA
09-Feb-2021 17:01:42.837 automatic empty zone: 103.100.IN-ADDR.ARPA
09-Feb-2021 17:01:42.837 automatic empty zone: 104.100.IN-ADDR.ARPA
09-Feb-2021 17:01:42.837 automatic empty zone: 105.100.IN-ADDR.ARPA
09-Feb-2021 17:01:42.837 automatic empty zone: 106.100.IN-ADDR.ARPA
09-Feb-2021 17:01:42.837 automatic empty zone: 107.100.IN-ADDR.ARPA
09-Feb-2021 17:01:42.837 automatic empty zone: 108.100.IN-ADDR.ARPA
09-Feb-2021 17:01:42.837 automatic empty zone: 109.100.IN-ADDR.ARPA
09-Feb-2021 17:01:42.837 automatic empty zone: 110.100.IN-ADDR.ARPA
09-Feb-2021 17:01:42.837 automatic empty zone: 111.100.IN-ADDR.ARPA
09-Feb-2021 17:01:42.837 automatic empty zone: 112.100.IN-ADDR.ARPA
09-Feb-2021 17:01:42.837 automatic empty zone: 113.100.IN-ADDR.ARPA
09-Feb-2021 17:01:42.837 automatic empty zone: 114.100.IN-ADDR.ARPA
09-Feb-2021 17:01:42.837 automatic empty zone: 115.100.IN-ADDR.ARPA
09-Feb-2021 17:01:42.837 automatic empty zone: 116.100.IN-ADDR.ARPA
09-Feb-2021 17:01:42.837 automatic empty zone: 117.100.IN-ADDR.ARPA
09-Feb-2021 17:01:42.837 automatic empty zone: 118.100.IN-ADDR.ARPA
09-Feb-2021 17:01:42.837 automatic empty zone: 119.100.IN-ADDR.ARPA
09-Feb-2021 17:01:42.837 automatic empty zone: 120.100.IN-ADDR.ARPA
09-Feb-2021 17:01:42.837 automatic empty zone: 121.100.IN-ADDR.ARPA
09-Feb-2021 17:01:42.837 automatic empty zone: 122.100.IN-ADDR.ARPA
09-Feb-2021 17:01:42.837 automatic empty zone: 123.100.IN-ADDR.ARPA
09-Feb-2021 17:01:42.837 automatic empty zone: 124.100.IN-ADDR.ARPA
09-Feb-2021 17:01:42.837 automatic empty zone: 125.100.IN-ADDR.ARPA
09-Feb-2021 17:01:42.837 automatic empty zone: 126.100.IN-ADDR.ARPA
09-Feb-2021 17:01:42.837 automatic empty zone: 127.100.IN-ADDR.ARPA
09-Feb-2021 17:01:42.837 automatic empty zone: 254.169.IN-ADDR.ARPA
09-Feb-2021 17:01:42.837 automatic empty zone: 2.0.192.IN-ADDR.ARPA
09-Feb-2021 17:01:42.837 automatic empty zone: 100.51.198.IN-ADDR.ARPA
09-Feb-2021 17:01:42.837 automatic empty zone: 113.0.203.IN-ADDR.ARPA
09-Feb-2021 17:01:42.837 automatic empty zone: 255.255.255.255.IN-ADDR.ARPA
09-Feb-2021 17:01:42.837 automatic empty zone: 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.0.IP6.ARPA
09-Feb-2021 17:01:42.837 automatic empty 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
09-Feb-2021 17:01:42.837 automatic empty zone: D.F.IP6.ARPA
09-Feb-2021 17:01:42.838 automatic empty zone: 8.E.F.IP6.ARPA
09-Feb-2021 17:01:42.838 automatic empty zone: 9.E.F.IP6.ARPA
09-Feb-2021 17:01:42.838 automatic empty zone: A.E.F.IP6.ARPA
09-Feb-2021 17:01:42.838 automatic empty zone: B.E.F.IP6.ARPA
09-Feb-2021 17:01:42.838 automatic empty zone: 8.B.D.0.1.0.0.2.IP6.ARPA
09-Feb-2021 17:01:42.838 automatic empty zone: EMPTY.AS112.ARPA
09-Feb-2021 17:01:42.840 configuring command channel from '/etc/bind/rndc.key'
09-Feb-2021 17:01:42.840 open: /etc/bind/rndc.key: permission denied
09-Feb-2021 17:01:42.840 couldn't add command channel 127.0.0.1#953: permission denied
09-Feb-2021 17:01:42.840 configuring command channel from '/etc/bind/rndc.key'
09-Feb-2021 17:01:42.840 open: /etc/bind/rndc.key: permission denied
09-Feb-2021 17:01:42.840 couldn't add command channel ::1#953: permission denied
09-Feb-2021 17:01:42.840 not using config file logging statement for logging due to -g option
09-Feb-2021 17:01:42.841 managed-keys-zone: journal file is out of date: removing journal file
09-Feb-2021 17:01:42.841 managed-keys-zone: loaded serial 2
09-Feb-2021 17:01:42.843 zone 0.in-addr.arpa/IN: loaded serial 1
09-Feb-2021 17:01:42.845 zone shiyanlou.example.com/IN: has no NS records
09-Feb-2021 17:01:42.845 zone shiyanlou.example.com/IN: not loaded due to errors.
09-Feb-2021 17:01:42.848 zone localhost/IN: loaded serial 2
09-Feb-2021 17:01:42.848 zone 127.in-addr.arpa/IN: loaded serial 1
09-Feb-2021 17:01:42.848 zone 168.192.in-addr.arpa/IN: has no NS records
09-Feb-2021 17:01:42.848 zone 168.192.in-addr.arpa/IN: not loaded due to errors.
09-Feb-2021 17:01:42.848 zone 255.in-addr.arpa/IN: loaded serial 1
09-Feb-2021 17:01:42.849 all zones loaded
09-Feb-2021 17:01:42.849 running

 

^C09-Feb-2021 17:01:45.489 shutting down
09-Feb-2021 17:01:45.490 no longer listening on ::#53
09-Feb-2021 17:01:45.490 no longer listening on 192.168.42.5#53
09-Feb-2021 17:01:45.494 exiting
shiyanlou:~/ $ sudo service bind9 status [17:01:45]
* bind9 is not running
shiyanlou:~/ $ sudo service bind9 restart [17:01:48]
* Stopping domain name service... bind9 waiting for pid 1759 to die
[ OK ]
* Starting domain name service... bind9 [ OK ]
shiyanlou:~/ $ sudo service bind9 status [17:01:56]
* bind9 is running
shiyanlou:~/ $ nslookup ns1.shiyanlou.example.com [17:01:59]
Server: 192.168.42.5
Address: 192.168.42.5#53

** server can't find ns1.shiyanlou.example.com: SERVFAIL

shiyanlou:~/ $ nslookup host1.shiyanlou.example.com [17:02:21]
Server: 192.168.42.5
Address: 192.168.42.5#53

** server can't find host1.shiyanlou.example.com: SERVFAIL

shiyanlou:~/ $ [17:02:43]