dns - Bind9:限制子网查询
问题描述
我有一台带有 WiFi 热点的 linux 机器,在 172.30.108.0/24 网络中分配 IP。
我已经安装了绑定 9。我的named.conf 只包含“include”/etc/bind/named.conf.local“;”,其他所有内容都被禁用。
我的 named.conf.local 有:
options {
listen-on port 53 { 0.0.0.0; };
listen-on-v6 port 53 { ::1; };
directory "/var/cache/bind";
allow-query { localhost; };
recursion yes;
querylog yes;
};
acl clients {
172.30.108.0/24;
};
view "internal-view" {
match-clients { internal; };
allow-query { internal; };
allow-query-cache { internal; };
zone "limit.com." {
type master;
file "/etc/bind/db.limit.com";
};
# Mapping: Everything else to 127.0.0.1
zone "." {
type master;
file "/etc/bind/db.mapping";
};
};
view "external-view" {
match-clients { any; };
allow-query { any; };
allow-recursion { any; };
allow-query-cache { any; };
zone "wiincon.de." {
type master;
file "/etc/bind/db.limit.com";
};
include "/etc/bind/named.conf.default-zones";
};
我的 db.limit.com:
; BIND reverse data file for broadcast zone
;
$TTL 180
@ IN SOA localhost. root.localhost. (
5 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS localhost.
@ IN A 192.168.5.5
www IN A 192.168.5.5
最后是我的 db.mapping:
; BIND reverse data file for broadcast zone
;
$TTL 3600
@ IN SOA localhost. root.localhost. (
4 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL
;
@ IN NS localhost.
* IN A 127.0.0.1
我现在的问题是:172.30.108.0/24 中的客户可以查询任何内容,但 www.limit.com
实际上:来自 172.30.108.0/24 的客户端应该能够解析 limit.com 和 www.limit.com,其他一切都应该以 127.0.0.1 响应。
当做一个 nslookup 我得到
非权威答案:***找不到limit.com:没有答案
我确定我在这里遗漏了一些非常明显的东西。非常感谢任何帮助。
解决方案
找到了。问题是“SYSTEM”本身有 8.8.8.8 作为名称服务器,因此绕过了本地的所有内容。
推荐阅读
- azure-data-explorer - Kusto如何在一组每日记录中选择最新的具有相同id的记录
- concurrency - VHDL 断言 - 并发语句
- java - 如何降低此代码的复杂性?
- variables - 使用 CX CAS 求解方程组时规避资源耗尽错误
- java - 如何在多值哈希图中的值搜索为真时打印键?
- python-3.x - 树莓派 4 上的 PyQt5
- c# - 无需编辑类即可获得 `JsonConstructor` 的效果
- git - 测试SSH连接后仍然需要登录
- c# - 如何检查一个列表是否包含另一个列表的 2 个元素以及更多元素?
- jquery - 如何捕捉 select2 下拉菜单的宽度?