//需要新增的域名 zone "k3k5.com" IN { type master; file "k3k5.com.zone"; }; //需要新增的域名 zone "50.168.192.in-addr.arpa" IN { type master; file "50.168.192.zone"; }; //以下是系统内建内容 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; }; };
zone "1.0.0.127.in-addr.arpa" IN { type master; file "named.loopback"; allow-update { none; }; };
zone "0.in-addr.arpa" IN { type master; file "named.empty"; allow-update { none; }; };
这篇文章是由Siralop写的
创建正向解析文件
sudo cp -p /var/named/named.localhost /var/named/k3k5.com.zone sudo vim /var/named/k3k5.com.zone 文件内容:
1 2 3 4 5 6 7 8 9 10 11 12 13
$TTL 1D @ IN SOA k3k5.com. root.k3k5.com. ( 1 ; serial 1D ; refresh 1H ; retry 1W ; expire 3H ) ; minimum NS dns.k3k5.com. dns A 192.168.50.XXX test1 A 192.168.50.201 test2 A 192.168.50.202 testc CNAME test1
这篇文章是由Siralop写的 这篇文章是由Siralop写的
创建反向解析文件
sudo cp -p /var/named/named.empty /var/named/50.168.192.zone sudo vim /var/named/50.168.192.zone 文件内容
Job for named.service failed because the control process exited with error code. See "systemctl status named.service" and "journalctl -xe" for details.
查看日志,开始排错 这篇文章是由Siralop写的 sudo journalctl -xe
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
2月 26 15:12:50 bogon bash[127386]: _default/k3k5.com/IN: unknown class/type 2月 26 15:12:50 bogon bash[127386]: zone localhost.localdomain/IN: loaded serial 0 2月 26 15:12:50 bogon bash[127386]: 50.168.192.zone:8: unknown RR type 'dns.k3k5.com.' 2月 26 15:12:50 bogon bash[127386]: zone 50.168.192.in-addr.arpa/IN: loading from master file 50.168.192.zone f 2月 26 15:12:50 bogon bash[127386]: zone 50.168.192.in-addr.arpa/IN: not loaded due to errors. 2月 26 15:12:50 bogon bash[127386]: _default/50.168.192.in-addr.arpa/IN: unknown class/type 2月 26 15:12:50 bogon bash[127386]: zone localhost/IN: loaded serial 0 2月 26 15:12:50 bogon bash[127386]: 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.ar 2月 26 15:12:50 bogon bash[127386]: zone 1.0.0.127.in-addr.arpa/IN: loaded serial 0 2月 26 15:12:50 bogon bash[127386]: zone 0.in-addr.arpa/IN: loaded serial 0 2月 26 15:12:50 bogon systemd[1]: named.service: control process exited, code=exited status=1 2月 26 15:12:50 bogon systemd[1]: Failed to start Berkeley Internet Name Domain (DNS). -- Subject: Unit named.service has failed -- Defined-By: systemd