bind限制网段

蒜香大龙虾 2024-08-07 23:50:47
Categories: Tags:

限制bind查询网段

修改配置文件

编辑/etc/named.conf,此处为只允许localhost查询

1
2
3
4
options {
...
allow-query { localhost; };
}

修改后重启,在其他机子查询dns结果如下

1
2
3
4
5
[root@linux2 named]# nslookup dns.skills.com 172.20.20.11
Server: 172.20.20.11
Address: 172.20.20.11#53

** server can't find dns.skills.com: REFUSED

可以指定网段,e.g.

1
2
3
4
options {
...
allow-query { 172.20.20.0/24; 192.168.0.1; ...; };
}