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

Bind 9 - allow-query-on versus listen-on

· 52CE 我爱测

I was just wondering about differences in behavior between Bind 9's allow-query-on and listen-on statements. They appear to perform similar functions. According to Chapter 6 of the ARM ("Bind 9 Configuration"): The interfaces and…

问题原文

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

I was just wondering about differences in behavior between Bind 9's allow-query-on and listen-on statements. They appear to perform similar functions. According to Chapter 6 of the ARM ("Bind 9 Configuration"):

The interfaces and ports that the server will answer queries from may be specified using the listen-on option.

The syntax given is:

listen-on [ port ip_port ] [ dscp ip_dscp ] { address_match_list } ;

Also in the same chapter:

allow-query-on: Specifies which local addresses can accept ordinary DNS questions.

The syntax given is:

allow-query-on { address_match_list } ;

From the syntax, it looks like allow-query-on does not allow port numbers to be specified. Are there other differences too?

已采纳解答

原帖链接 · bodgit · CC BY-SA 4.0

They're not really similar functions. The listen-on statement is required for named to bind on a specific IP address and port. Without setting it, the default is to listen for DNS queries on port 53 of all interfaces on your server. If you have a server with multiple interfaces and you only want to provide DNS services on one of them, use listen-on to only listen on the one interface. Trying to do it the other way with allow-query-on only will leave BIND still listening on all interfaces. The best way is to use both, i.e. bind to only the interface(s) you need and then further restrict the type of queries you permit.

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

资料来源与适用范围

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

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

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