Linux

需要幫助配置 DNS 伺服器

  • June 1, 2016

我想執行一個 dns 伺服器來擁有自己的名稱伺服器:ns1.radicalteam.ir 和 ns2.radicalteam.ir

我有一個 VPS 並在其上安裝了 Centos 6.5,以及我設置了 soulati 的激進團隊.ir 和 soulati.ir 域。 ir 名稱伺服器到 ns1.radicalteam.ir 和 ns2.radicalteam.ir 我可以訪問 radicaalteam.ir 但 soulati.ir 無法訪問。問題是什麼 ??

這是我在 bind 中的配置:

/etc/named.conf :

options {
   listen-on port 53 { 185.94.97.188;127.0.0.1; };
   allow-query     { any; };
   Allow-transfer {"none";};
   Allow-recursion {"none";};
   Recursion no;
};

zone "server.radicalteam.ir" {
type master;
file "/var/named/server.radicalteam.ir.zone";
};

zone "radicalteam.ir" {
type master;
file "/var/named/radicalteam.ir.zone";
};

/var/named/server.radicalteam.ir.zone :

$TTL 1D
@   IN  SOA ns1.radicalteam.ir. admin.radicalteam.ir. (
                                       1       ; serial
                                       1D      ; refresh
                                       1H      ; retry
                                       1W      ; expire
                                       3H )    ; minimum

server.radicalteam.ir. IN  NS   ns1.radicalteam.ir.
server.radicalteam.ir. IN  NS   ns2.radicalteam.ir.
server.radicalteam.ir. IN  A    185.94.97.188
server.radicalteam.ir. IN  MX   0 server.radicalteam.ir.

/var/named/radicalteam.ir.zone :

$TTL 1D
@   IN  SOA ns1.radicalteam.ir. server.radicalteam.ir. (
                                       0       ; serial
                                       1D      ; refresh
                                       1H      ; retry
                                       1W      ; expire
                                       3H )    ; minimum

radicalteam.ir. IN  NS      ns1.radicalteam.ir.
radicalteam.ir. IN  NS      ns2.radicalteam.ir.
radicalteam.ir. IN  A       185.94.97.188
ns1     IN  A   185.94.97.188
ns2     IN  A   185.94.97.188
radicalteam.ir. IN  MX  0  radicalteam.ir.
www         IN  CNAME   radicalteam.ir.

nslookup -debug 激進團隊.ir

Server:     127.0.1.1
Address:    127.0.1.1#53

------------
   QUESTIONS:
   radicalteam.ir, type = A, class = IN
   ANSWERS:
   ->  radicalteam.ir
   internet address = 185.94.97.188
   ttl = 86400
   AUTHORITY RECORDS:
   ->  radicalteam.ir
   nameserver = ns2.radicalteam.ir.
   ttl = 1290
   ->  radicalteam.ir
   nameserver = ns1.radicalteam.ir.
   ttl = 1290
   ADDITIONAL RECORDS:
   ->  ns1.radicalteam.ir
   internet address = 185.94.97.188
   ttl = 1290
   ->  ns2.radicalteam.ir
   internet address = 185.94.97.188
   ttl = 56785
------------
Non-authoritative answer:
Name:   radicalteam.ir
Address: 185.94.97.188

ping soulati.ir :

ping: unknown host soulati.ir

nslookup soulati.ir:

Server:     127.0.1.1
Address:    127.0.1.1#53

** server can't find soulati.ir: SERVFAIL

nslookup -debug soulati.ir

Server:     127.0.1.1
Address:    127.0.1.1#53

------------
   QUESTIONS:
   soulati.ir, type = A, class = IN
   ANSWERS:
   AUTHORITY RECORDS:
   ADDITIONAL RECORDS:
------------
** server can't find soulati.ir: SERVFAIL

兩者都ns1.radicalteam.ir解析ns2.radicalteam.ir到同一個地址,185.94.97.188如果這些應該是您的“名稱伺服器”,這本身就是一個壞主意

至於soulati.ir(委託給上面的“nameserver s ”),185.94.97.188用 status 響應REFUSED,大概是因為你沒有配置這樣的區域。(如果問題中包含的配置是確認這一點的完整配置。)

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