BIND9 不监听外部 IP

BIND9 不监听外部 IP

我正在尝试配置绑定以在外部网络广播我的域,但我的服务器没有监听外部 IP。

本地一切运行正常。

我的网络界面:

 enp4s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
       inet INTERNAL_IP  netmask 255.255.255.0  broadcast 192.168.55.255
       inet6 INTERNAL_IP_V6  prefixlen 64  scopeid 0x20<link>


 lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
       inet 127.0.0.1  netmask 255.0.0.0
       inet6 ::1  prefixlen 128  scopeid 0x10<host>
       loop  txqueuelen 1000  (Local Loopback)

即使关闭了 iptables:

sudo iptables -L -n
Chain INPUT (policy DROP)
target     prot opt source               destination
ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0

Chain FORWARD (policy DROP)
target     prot opt source               destination
ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0

命名的.conf.选项:

    options {
    directory "/var/cache/bind";
    statistics-file "/run/named/named.stats";
    pid-file "/run/named/named.pid";
    session-keyfile "/run/named/session.key";

     forwarders {
            x.x.x.x;     # gateway or router
            8.8.8.8;
            8.8.4.4;
            external ip;
     };

    dnssec-validation auto;

    listen-on-v6 port 53 {any;};

    listen-on port 53 {any;};

    auth-nxdomain yes;            # conform to RFC1035
    allow-query { any; };         # allow anyone to issue queries
    allow-recursion { any; };
    allow-query-cache { any; };
    recursion no;                 # disallow recursive queries
    version "[SECURED]";
};

网络状态:

netstat -tulpn | grep :53
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
tcp        0      0 INTERNAL_IP:53          0.0.0.0:*               LISTEN      -
tcp        0      0 127.0.0.1:53            0.0.0.0:*               LISTEN      -
tcp6       0      0 :::53                   :::*                    LISTEN      -
udp        0      0 INTERNAL_IP:53          0.0.0.0:*                           -
udp        0      0 127.0.0.1:53            0.0.0.0:*                           -
udp        0      0 0.0.0.0:5353            0.0.0.0:*                           -
udp6       0      0 :::53                   :::*                                -
udp6       0      0 :::5353                 :::*                                -

ufw:

sudo ufw status
Status: active

To                         Action      From
--                         ------      ----
DNS                        ALLOW       Anywhere
DNS (v6)                   ALLOW       Anywhere (v6)

nmap 显示:

53/tcp filtered domain 

我究竟做错了什么?

提前感谢您的帮助,Slawek。

答案1

我在 ubuntu 22 上使用 bind9 测试了您的配置。它正在运行。我认为您的端口转发功能运行不佳。您应该为 tcp 和 udp 协议进行端口转发

答案2

关闭,暂时停止乐趣,没有时间。感谢您的关注,我知道我还需要检查什么。问候。

相关内容