大网数据广告活动
服务器运维问答

firewall rules for bind9

· 52CE 我爱测

cat /etc/bind/named.conf.options // 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. I didn't find any information about what are the …

问题原文

原帖链接 · Pol Hallen · CC BY-SA 3.0

cat /etc/bind/named.conf.options

    // 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.

I didn't find any information about what are the exact firewall rules to apply with a firewall between nameservers and I.

社区高分解答

原帖链接 · krisFR · CC BY-SA 3.0

A standard DNS query is made by Client from any port, to UDP/53 DNS Server port.

Then, DNS Server answer from UDP/53 to any client port :

Client:Any ---query--> DNSServer:UDP/53 --
                                          |
Client:Any <--answer-- DNSServer:UDP/53 -<

As a sample, iptables rules for Client would look like this :

iptables -A OUTPUT -d DNSServer -p udp -dport 53 -j ACCEPT
iptables -A INPUT -s DNSServer -p udp -sport 53 -j ACCEPT

Basically, DNS queries uses UDP unless queries/answer are less or equal than 512 bytes.

If a DNS query/response exceeds 512 bytes then protocol will switch to TCP/53. You will need TCP only in cases when DNS Servers have to speak together, for zone transfert (axfr) as a sample.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2017-11-03)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。