dig/nslookup 返回 servfail 错误

dig/nslookup 返回 servfail 错误

在过去的几天里,我遇到了一个似乎无法解决的问题。目前我的网络中只有一台机器,它只是一台安装并配置了 DNS 和其他服务的 RHEL 8 服务器。问题是当我尝试挖掘或使用 nslookup 时,我收到 servfail 错误。有人能发现我是否配置了错误吗?

Server:     192.168.50.100
Address:    192.168.50.100#53

** server can't find salt.jenna.af: SERVFAIL

挖掘输出:

[root@salt named]# dig salt.jenna.af

; <<>> DiG 9.11.36-RedHat-9.11.36-3.el8_6.1 <<>> salt.jenna.af
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 29195
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
; COOKIE: 13c6c973e66bb6eed834a40363600d050510d121b2e7ee40 (good)
;; QUESTION SECTION:
;salt.jenna.af.         IN  A

;; Query time: 0 msec
;; SERVER: 192.168.50.100#53(192.168.50.100)
;; WHEN: Mon Oct 31 10:59:33 PDT 2022
;; MSG SIZE  rcvd: 70

下面是我的 /etc/named.conf 和 /var/named/jenna.af.db (named.empty) 文件。

//
// named.conf
//
// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS
// server as a caching only nameserver (as a localhost DNS resolver only).
//
// See /usr/share/doc/bind*/sample/ for example named configuration files.
//

options {
    listen-on port 53 { 127.0.0.1; any; };
        listen-on-v6 port 53 { ::1; any; };
        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";
        secroots-file   "/var/named/data/named.secroots";
        recursing-file  "/var/named/data/named.recursing";
        allow-query     { localhost; any;};

};

zone "." IN {
        type hint;
        file "named.ca";
};

zone "jenna.af" IN {
        type master;
        file "jenna.af.db";
        allow-query {any; };
};

include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";

$TTL 3H
@       IN SOA   salt.jenna.af. root.jenna.af. (
                                        311022  ; serial
                                        1D      ; refresh
                                        1H      ; retry
                                        1W      ; expire
                                        3H )    ; minimum
;
@       IN      NS      localhost.
salt    IN      A       192.168.50.100
client  IN      A       192.168.50.200

如果有任何不清楚的地方或需要更多信息,我很乐意提供。

先感谢您

答案1

您提到您的服务器是 RHEL 8。您的文件名和某些内容看起来很陌生,但我不知道这是不是 RHEL 与 Ubuntu 的做法不同。

由于您的服务器不是 Ubuntu,因此您的问题与此无关。但无论如何...

我认为这行:

@       IN SOA   salt.jenna.af. root.jenna.af. (

应该是这样的:

@       IN SOA   jenna.af. root.jenna.af. (

并且它应该有一个定义的 IP 地址。我也不知道如何使用 localhost。总的来说,我建议这样做:

$TTL 3H
@       IN SOA   jenna.af. root.jenna.af. (
                                        311022  ; serial
                                        1D      ; refresh
                                        1H      ; retry
                                        1W      ; expire
                                        3H )    ; minimum
        IN      A       192.168.50.100 
;
@       IN      NS      salt.jenna.af.
salt    IN      A       192.168.50.100
client  IN      A       192.168.50.200

你也应该尝试一下 named-checkzone 程序。最后,我只知道以下信息Ubuntu 服务器指南提供。

相关内容