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

BIND DNS recursion only to my domain

· 52CE 我爱测

I am asked to allow recursion just to the clients belonging to an specific domain. I thought I could go to my named.conf and add in the options area this line: allow-recursion { myDomain ; }; but then I realized this was a huge m…

问题原文

原帖链接 · Carlos Martel Lamas · CC BY-SA 3.0

I am asked to allow recursion just to the clients belonging to an specific domain. I thought I could go to my named.conf and add in the options area this line: allow-recursion { myDomain ; }; but then I realized this was a huge mistake, is there any way to allow DNS recursion to the clients in my domain without having to write every IP address on the allow-recursion{}; list?

已采纳解答

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

If there is a particular subnet, then one can allow recursion via something like:

acl trustednets {
    # server itself
    localhost;
    # the subnet
    192.0.2.0/24;
    # any others... (BIND also has a "localnets" to trust
    # connected subnets, if that is appropriate)
};
options {
    ...
    allow-recursion { trustednets; };
};

Another option is to use views; this may suit DNS servers open to the public and also used by client systems, though is more complicated:

acl trustednets {
    ...  # as above
};
view favoredclients {
    match-clients      { trustednets; };
    match-destinations { trustednets; };
    recursion yes;
    zone ...  # zones probably best done via include
};
view thewashedmasses {
    recursion no;
    # https://rhn.redhat.com/errata/RHSA-2013-0550.html
    rate-limit {
            responses-per-second 5;
            window 5;
    };
    zone ...  # best done via include (because duplicated here)
};

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

资料来源与适用范围

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

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

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