I am trying to set up the following scenario:
Local raspberry (192.168.0.9) is used as both dhcp server (dhcpd) and dns server (dnsmasq).
I have two sets of devices (my own and everyone else's), that receive their IP addresses from specific ranges and DNS Servers specified in dhcpd.conf as this:
subnet 192.168.0.0 netmask 255.255.255.0 {
option routers 192.168.0.1;
pool {
deny unknown-clients;
range 192.168.0.20 192.168.0.40;
option domain-name-servers 192.168.0.9;
host A {
hardware ethernet 11:22:33:44:55:66;
fixed-address 192.168.0.21;
}
host B {
hardware ethernet 66:55:44:33:22:11;
fixed-address 192.168.0.22;
}
pool {
range 192.168.0.2 192.168.0.19;
allow unknown-clients;
deny known-clients;
option domain-name-servers 8.8.8.8;
}
}
That works fine. I have my own devices use dnsmasq for specific rules, ad-blocking and so on, while other clients use google's dns without restrictions.
However, I would like to
- have IP assignment done via dhcpd pools, but
- use dnsmasq as dns server for both IP address ranges
- provide every client that connects with some locally defined name resolution provided by dnsmasq entries (like 'address=/homenet_files/192.168.0.9')
- use different upstream servers for the different IP ranges in dnsmasq
example: client in IP range 192.168.0.20 - 40 should use opendns
server=208.67.222.222
, others
server=8.8.8.8
Is there a way to provide different configuration files for specified IP ranges? tbh the dnsmasq manual is over my head regarding this question. Any help appreciated.