我在设置具有正向和反向区域的本地 DNS 服务器时遇到了麻烦。
解析配置文件
search myco.nmm6145.com
nameserver 192.168.1.1
nameserver 192.168.1.2
命名配置文件
options {
directory "/var/named";
listen-on port 53 {any;};
allow-query {localhost;};
allow-transfer {any;};
empty-zones-enable no;
recursion yes;
dnssec-enable yes;
dnssec-validation yes;
bindkeys-file "/etc/named.root.key";
managed-keys-directory "/var/named/dynamic";
pid-file "/run/named/named.pid";
session-keyfile "/run/named/session.key";
};
zone "." { type hint; file "named.ca"; allow-query {any;};};
zone "0.0.127.in-addr.arpa." { type master; file "db.127.0.0"; allow-query{any;};};
zone "myco.nmm6145.com" { type master; file "db.myco"; allow-query{any;};};
zone "1.168.192.in-addr.arpa." { type master; file "db.192.168.1"; };
zone "20.168.192.in-addr.arpa." { type master; file "db.192.168.20"; };
include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";
菌核病
$TTL 86400
@ SOA linserv.nmm6145.com hostmaster ( 2003080800 12h 15m 3w 3h )
; IAM NAME SERVER
IN NS linserv.nmm6145.com.
IN NS winserv.nmm6145.com.
; Canonical names
; More may need to be defined as the DNS group grows
localhost A 127.0.0.1
linserv IN A 192.168.1.1
winserv IN A 192.168.1.2
; No Aliases yet
www IN CNAME winclient
;No interface spec. names yet
数据库.192.168.20
$TTL 86400
;$ORIGIN 20.168.192.in-addr.arpa.
@ IN SOA linserv.nmm6145.com hostmaster.myco.nmm6145.com. ( 2003080700 3h 15m 3w 3h )
;NS
@ IN NS linserv.nmm6145.com.
@ IN NS winserv.nmm6145.com.
@ IN PTR nmm6145.com.
;Addr
linserv IN A 192.168.1.1
winserv IN A 192.168.1.2
;PTR
2 IN PTR winserv.nmm6145.com.
1 IN PTR linserv.nmm6145.com.
数据库.192.168.1
$TTL 86400
$ORIGIN 1.168.192.in-addr.arpa.
@ SOA linserv.nmm6145.com hostmaster.myco.nmm6145.com. ( 2003080600 3h 15m 3w 3h )
;NS
@ IN NS linserv.nmm6145.com.
@ IN NS winserv.nmm6145.com.
@ IN PTR nmm6145.com
linserv IN A 192.168.1.1
winserv IN A 192.168.1.2
;PTR
192.168.1.1 IN PTR linserv.nmm6145.com.
192.168.1.2 IN PTR winserv.nmm6145.com.
数据库.127.0.0
$TTL 86400
$ORIGIN 0.0.127.in-addr.arpa.
@ IN SOA linserv.nmm6145.com hostmaster.myco.nmm6145.com ( 2003080500 3h 15m 3w 3h )
; Define Name Server
IN NS linserv.nmm6145.com.
IN NS winserv.nmm6145.com.
; Give localhost ptr
1 IN PTR localhost.
;Hostname to Address
;linserv IN A 127.0.0.1
以下是我为诊断问题而运行的一些命令:
nslookup @localhost linserv.myco.nmm6145.com
;;Got SERVFAIL reply from 192.168.122.1, trying next server
不确定 122 子网在这里发挥作用,似乎无法在我的任何区域或配置文件中找到它。
挖 nmm6145
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 16519
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1
;; QUESTION SECTION:
;; nmm6145. IN A
;;SERVER: 192.168.1.2#53(192.168.1.2)
我也尝试过通过以下方式刷新缓存
$rndc 刷新