是否可以从单个 ISC DHCP 服务器发送不同的子网 DNS?

是否可以从单个 ISC DHCP 服务器发送不同的子网 DNS?

我要介绍的情况是,为一个隔离的 VLAN 发送不同的 DNS 服务器,其目的是为我们的客人提供仅可访问互联网的权限。它无法访问我们的内部网络,因此它不应使用引用内部地址的 DNS。

设置该 DNS 所导致的问题是,如果我们的雇主由于某种原因要使用该仅限访客的 VLAN,他们将无法访问我们的邮件服务器,因为它尝试通过内部地址进行连接,而该内部地址是该子网无法访​​问的。

例子:

Guest only VLAN is 1000, subnet provided there via DHCP is 192.168.1.0/26,
traffic is limited to that subnet and to internet only,
that DHCP server has also pools 192.168.1.128/25, 192.168.2.0/23 and 192.168.4.0/22,
which are getting DNS servers from 192.168.1.64/26, but for the 192.168.1.0/26 subnet
I'd like to provide google DNSes: 8.8.8.8 and 8.8.4.4

单个 DHCP 服务器上是否可以进行这样的配置 - “每个子网 DNS”配置?如果不能,是否可以在单个物理/虚拟机上运行 2 个 ISC DHCP 服务器实例,并使用不同的配置(以及如何实现)?

答案1

是的,这是可能的。您可以创建多个子网条目并为每个子网条目指定自己的 DNS 配置,如下所示:

# guests
subnet 192.168.1.0 netmask 255.255.255.192 {
    option routers 192.168.1.1;
    option subnet-mask 255.255.255.192;
    option domain-name-servers 8.8.8.8 8.8.8.4;
    # other config statements here
}
# trusted
subnet 192.168.2.0 netmask 255.255.254.0 {
    option routers 192.168.2.1;
    option subnet-mask 255.255.254.0;
    option domain-name-servers 192.168.1.64;
    # other config statements here
}
 # trusted
subnet 192.168.4.0 netmask 255.255.252.0 {
    option routers 192.168.4.1;
    option subnet-mask 255.255.252.0;
    option domain-name-servers 192.168.1.64;
    # other config statements here
}

相关内容