Is it possible to send different-per-subnet DNSes from the single ISC DHCP server

domain-name-systemisc-dhcpsubnetvlan

The case I want to cover is to send different DNS server for one, isolated VLAN, which purpose is to give internet-only access – for our guests. It has no access to our internal network, so it shouldn't use DNS referring to internal addresses.

The problem, that is caused by setting that DNS is, that, if our employers are up to use that guest-only VLAN for some reason, they have no access to our mail server, as it tries to connect via internal address, which is not reachable from that subnet.

Example:

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

Is such configuration possible at single DHCP server – the 'per subnet dns' configuration?
If not, is it possible to run 2 instances of ISC DHCP server at single physical/virtual machine, with different configs(and how do I achieve that)?

Best Answer

Yes, it is possible. You can create multiple subnet entries and give each its own DNS config, something like this:

# 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
}
Related Topic