我正在尝试在 centos 7 上配置 DNS 服务器。我正在关注这链接。当我运行时,dig -x 192.168.40.107
我没有收到任何答案记录。这是输出
; <<>> DiG 9.11.4-P2-RedHat-9.11.4-26.P2.el7_9.13 <<>> -x 192.168.40.107
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 24981
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 1, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;107.40.168.192.in-addr.arpa. IN PTR
;; AUTHORITY SECTION:
168.192.IN-ADDR.ARPA. 86400 IN SOA 168.192.IN-ADDR.ARPA. . 0 28800 7200 604800 86400
;; Query time: 0 msec
;; SERVER: 127.0.0.1#53(127.0.0.1)
;; WHEN: Thu Mar 09 16:18:26 +04 2023
;; MSG SIZE rcvd: 111
我做错了什么?谢谢 我的配置文件是
/etc/named.conf
options {
listen-on port 53 { 127.0.0.1; 192.168.40.107; };
# listen-on-v6 port 53 { ::1; };
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
memstatistics-file "/var/named/data/named_mem_stats.txt";
recursing-file "/var/named/data/named.recursing";
secroots-file "/var/named/data/named.secroots";
allow-query { localhost; 192.168.40.0/24; };
recursion yes;
forwarders {
8.8.8.8;
8.8.4.4;
};
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";
};
logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
zone "." IN {
type hint;
file "named.ca";
};
include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";
include "/etc/named/named.conf.local";
/etc/named/named.conf.local
zone "okd.local" {
type master;
file "/etc/named/zones/db.okd.local"; # zone file path
};
zone "40.168.192.in-addr.erpa" {
type master;
file "/etc/named/zones/db.40.168.192"; # 192.168.40.0/24 subnet
};
/etc/named/zones/db.okd.local
$TTL 604800
@ IN SOA okd4-services.okd.local. admin.okd.local. (
1 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expiry
604800 ; Nagitave cache TTL
)
; name servers - NS Records
IN NS okd4-services
; name servers - A Records
okd4-services.okd.local. IN A 192.168.40.107
; OpenShift container plateform cluster - A Records
okd4-bootstrap.lab.okd.local. IN A 192.168.40.103
okd4-master1.lab.okd.local. IN A 192.168.40.104
okd4-worker1.lab.okd.local. IN A 192.168.40.105
okd4-worker2.lab.okd.local. IN A 192.168.40.106
; OpenShift internal cluster IPs - A Records
api.lab.okd.local. IN A 192.168.40.107
api-int.lab.okd.local. IN A 192.168.40.107
*.apps.lab.okd.local. IN A 192.168.40.107
etcd-0.lab.okd.local. IN A 192.168.40.104
console-openshift-console.apps.lab.okd.local. IN A 192.168.40.107
oauth-openshift.apps.lab.okd.local. IN A 192.168.40.107
; OpenShift internal cluster IPs - SRV Records
_etcd-server-ssl._tcp.lab.okd.local 86400 IN SRV 0 10 2380 etcd-0.lab
/etc/named/zones/db.40.168.192
$TTL 604800
@ IN SOA okd4-services.okd.local. admin.okd.local. (
6 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expiry
604800 ; Nagitave cache TTL
)
; name servers - NS Records
IN NS okd4-services.okd.local.
; name servers - PTR Records
107 IN PTR okd4-services.okd.local.
; OpenShift container Plateform Cluster - PTR Records
103 IN PTR okd4-bootstrap.lab.okd.local.
104 IN PTR okd4-master1.lab.okd.local.
105 IN PTR okd4-worker1.lab.okd.local.
106 IN PTR okd4-worker2.lab.okd.local.
107 IN PTR api.lab.okd.local.
107 IN PTR api-int.lab.okd.local.