前

当我通过顶级域名注册局的网站查询我的 DNS 服务器时.com**,我可以看到我的 DNS 服务器被找到了:

Query
Domain: example**.com**
Answer:
Following name-servers have been defined in **NIC DNS for your domain:

1. ns.example**.com**

IP addresses defined for NS servers in **NIC DNS (glue records):

1. ns.example**.com**. *4.*41.2*.1*4
Name Server: "ns.example**.com**"
List of defined name-servers in this name server is SYNC with the list of name-servers which has been defined in **NIC name-server.

List of name-server from this server:

1. ns.example**.com**

SOA detail from this server:

localhost. root.localhost. (
                    2021053002  ; Serial
                    10800   ; Refresh
                    3600    ; Retry
                    604800  ; Expire
                    86400 ) ; Minimum TTL

但在任何网络上,网络浏览器不是能够通过example**.com**地址显示我的网站。

我有哪些选项可以调试我的 DNS 服务器?谢谢!


更新

我可以通过 SSH 连接到服务器并运行此命令:

user@localhost:~> nslookup example**.com** 8*.*41.*3.1*4
;; connection timed out; no servers could be reached


还有这个命令:

user@localhost:~> nslookup example**.com** 
Server:         1.1.1.1
Address:        1.1.1.1#53

Non-authoritative answer:
*** Can't find example**.com**: No answer

答案1

服务器操作系统是 openSUSE Tumbleweed 32 位,其 DNS 服务器已通过 YAST2 配置。查看/etc/named.conf指示named工作目录:

options {

        # The directory statement defines the name server's working directory

        directory "/var/lib/named";

/etc/named.conf指示相对于工作目录的区域文件:

zone "example.com" in {
        allow-transfer { any; };
        file "master/example.comXX";
        type master;
};

/var/lib/named/master/example.comXX内容是:

$TTL 2d
@               IN SOA          localhost.      root.localhost. (
                                2021062000      ; serial
                                3h              ; refresh
                                1h              ; retry
                                1w              ; expiry
                                1d )            ; minimum

example.com.  IN NS           ns.example.com.
example.com   IN A            4.21.3.12
ns              IN A            4.21.3.12

/var/lib/named/master/example.comXX根据这里的例子修改的内容:

https://ubuntu.com/server/docs/service-domain-name-service-dns

/var/lib/named/master/example.comXX修改后新的是:

$TTL 2d
@               IN SOA          example.com.  root.example.com. (
                                2021062000      ; serial
                                3h              ; refresh
                                1h              ; retry
                                1w              ; expiry
                                1d )            ; minimum

@       IN NS           ns.example.com.
@       IN A            4.21.3.12
@       IN AAAA         ::1
ns      IN A            4.21.3.12

经过如上修改后/var/lib/named/master/example.comXX,现在可以通过网站地址来浏览网站了。

相关内容