讓本地 DNS 和名稱伺服器可以從互聯網訪問

讓本地 DNS 和名稱伺服器可以從互聯網訪問

我介紹了上下文:我有公共固定IP,它被設定為我在廣域網路上的pfsense;我的區域網路上有網際網路;在我的區域網路中,我有一個本地DNS伺服器(ubuntu 22.04,帶有bind9,ip 10.14.14.10),我在其中使用我購買的實際網域(mm-it.ro)設定區域;在註冊器上(我從那裡購買了網域)。我將網域名稱 mm-it.ro 設定為指向我的公共 IP (86.125.220.243);在 pfsense 中,在一般設定中,我輸入了內部 DNS 伺服器的 IP,並在 NAT&Rules 中設定了從連接埠 53 上的 WAN 到指向我的本機 DNS 伺服器 IP 的所有內容。

現在:在 LAN 中一切正常;我可以從我的區域網路中的任何客戶端在瀏覽器中解析:www.mm-it.ro,mail.mm-it.ro。但從互聯網上我無法訪問該域;我在註冊站點將公共 IP 註冊到該網域後,等待了大約 72 小時的傳播;我什麼也沒改變:a 無法 ping 到 mm-it.ro 或 ns1.mm-it.ro;在 mxtoolbox 中的 dns 查找中顯示“DNS 無有效名稱伺服器回應”,在我選擇“尋找問題”後,它顯示Unable to resolve "mm-it.ro" to an IP address

我不知道問題出在哪裡:在 pfsense 中還是在我的 dns 伺服器設定中,因為在我的本地網路中,一切正常?下面找到我在可能的伺服器上的設置

db.mm-it.ro(轉發)

$TTL    604800
@       IN      SOA     ns1.mm-it.ro. admin.mm-it.ro. (
                              6         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800 )       ; Negative Cache TTL
;
@       IN      NS      ns1.mm-it.ro.
        IN      MX      10      mail.mm-it.ro.
ns1     IN      A       10.14.14.10
mm-it.ro.       IN      A       10.14.14.10
www     IN      A       10.14.14.11
mail    IN      A       10.14.14.12 

db.10(反向)

$TTL    604800
@       IN      SOA     ns1.mm-it.ro. admin.mm-it.ro. (
                              5         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800 )       ; Negative Cache TTL
;
@       IN      NS      ns1.
10      IN      PTR     ns1.mm-it.ro.
10      IN      PTR     mm-it.ro.
11      IN      PTR     www.mm-it.ro.
12      IN      PTR     mail.mm-it.ro.

命名.conf.local

zone "mm-it.ro" {
        type master;
        file "/etc/bind/db.mm-it.ro";
};

zone "14.14.10.in-addr.arpa" {
        type master;
        notify no;
        file "/etc/bind/db.10";
};

命名.conf.選項

acl ips {
        86.125.220.243;
        localhost;
        localnets;
        10.14.14.0/24;
};

options {
        directory "/var/cache/bind";

        // If there is a firewall between you and nameservers you want
        // to talk to, you may need to fix the firewall to allow multiple
        // ports to talk.  See http://www.kb.cert.org/vuls/id/800113

        // If your ISP provided one or more IP addresses for stable
        // nameservers, you probably want to use them as forwarders.
        // Uncomment the following block, and insert the addresses replacing
        // the all-0's placeholder.

        recursion yes;
        allow-query { ips; };
        allow-query-cache { ips; };
        allow-recursion { ips; };

        forwarders {
                8.8.8.8;
                8.8.4.4;
        };

        //========================================================================
        // If BIND logs error messages about the root key being expired,
        // you will need to update your keys.  See https://www.isc.org/bind-keys
        //========================================================================
        
        dnssec-validation auto;

        listen-on-v6 port 53 { ::1; };
        listen-on port 53 { 127.0.0.1; 10.14.14.10; };
};

在 pfserver 中,規則將來自連接埠 53 上的 WAN 的所有內容重新導向到連接埠 53 到他的 ip 10.14.14.10 上的我的 dns 伺服器。我還禁用了服務Dns ResolverDNS Forwarder.

請幫我指出問題可能出在哪裡。

答案1

雖然,正如其他人所建議的,考慮到不同網域中的黏合記錄或 A 記錄已發布,很可能從網域內部為您的網域提供 DNS 服務,但不要這樣做。嚴重地。

DNS 託管確實很便宜 - 大多數註冊商在註冊時都會免費贈送它。相反,在互聯網上運行任何類型的伺服器都需要高水準的技能以及在強化和持續監控/維護方面的投資。存在很大的風險,您的 DNS 伺服器和潛在的網域可能會被濫用於非常邪惡的目的,而您對此一無所知,直到警察來敲您的門。

答案2

謝謝大家的回答。我知道我還必須為外部/互聯網(splitview)設置另一個區域。但我最終在 pfsense 中安裝了 bind 並在那裡進行了所有設置,現在可以使用了。謝謝。

相關內容