Domain-Name-System

通過我的域名註冊中心查詢 DNS 伺服器沒問題。但瀏覽器無法通過其地址獲取我的網站

  • June 20, 2021

當我通過.com**頂級域名註冊處的網站查詢我的DNS伺服器時,我可以看到我的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 伺服器?謝謝!

伺服器作業系統是 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上面的修改,現在可以通過地址瀏覽網站了。

引用自:https://serverfault.com/questions/1067227