gpt4 book ai didi

dns - 服务器找不到 NXDOMAIN

转载 作者:太空宇宙 更新时间:2023-11-03 17:16:31 35 4
gpt4 key购买 nike

我只是想在本地配置一个 DNS 服务器我配置/etc/named.conf

options {
listen-on port 53 {
127.0.0.1; 192.168.220.135;
};
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";
allow-query {
localhost; 192.168.220.0/24;
};
allow-transfer{
localhost; 192.168.220.136;
};
recursion yes;

dnssec-enable yes;
dnssec-validation yes;
dnssec-lookaside auto;

/* Path to ISC DLV key */
bindkeys-file "/etc/named.iscdlv.key";

managed-keys-directory "/var/named/dynamic";
also-notify {
};
};
logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
zone "." IN {
type hint;
file "named.ca";
};
zone "ayoub.local" IN {
type master;
file "direct.zone";
#allow-update {none;};
};
zone "220.168.192.in-addr.arpa" IN {
type master;
file "inverse.zone";
#allow-update {none;};};
include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";

和/var/named/direct.zone

    **$TTL 3H
@ IN SOA MasterDNS.ayoub.local. root.ayoub.local. (
20160421 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minim
@ IN NS MasterDNS.ayoub.local.
@ IN NS SlaveDNS.ayoub.local.
@ IN A 192.168.220.135
@ IN A 192.168.220.136
@ IN A 192.168.220.137
MasterDNS IN A 192.168.220.135
SlaveDNS IN A 192.168.220.136
Client IN A 192.168.220.137

和/var/named/inverse.zone

     $TTL 3H
@ IN SOA MasterDNS.ayoub.local. root.ayoub.local. (
20160418 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
@ IN NS MasterDNS.ayoub.local.
@ IN NS SlaveDNS.ayoub.local.
@ IN PTR ayoub.local.
MasterDNS IN A 192.168.220.135
SlaveDNS IN A 192.168.220.136
Client IN A 192.168.220.137
135 IN PTR MasterDNS.ayoub.local.
136 IN PTR SlaveDNS.ayoub.local.
137 IN PTR Client1.ayoub.local.

和/etc/resolv.conf

domain ayoub.local
search ayoub.local
nameserver 127.0.0.1
nameserver 192.168.220.136

当我用 nslookup 测试域名时

;; Got SERVFAIL reply from 127.0.0.1, trying next server
;; connection timed out; trying next origin
;; Got SERVFAIL reply from 127.0.0.1, trying next server
;; connection timed out; no servers could be reached

当我设置/etc/resolv.conf 时

search localdomain
nameserver 192.168.220.2

我看到了 nslookup 的结果

Server:         192.168.220.2
Address: 192.168.220.2#53

** server can't find ayoub.local: NXDOMAIN

最佳答案

有时由于名称服务器 127.0.0.1 而发生错误

所以在 resolve.conf 中使用以下名称服务器或您喜欢的任何其他名称服务器。

这是我的 resolve.conf 文件

nameserver 8.8.8.8
nameserver 1.1.1.1

关于dns - 服务器找不到 NXDOMAIN,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37188316/

35 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com