Thanks for yours suggestions.
*Regarding DHCP/VLAN:*
I forgot to add one thing - conditional forwarding should be done for specific clients *and* domains.
Hence DNS server assigned over DHCP or enforced DNAT of all requests to a DNS server is not suitable here.
*Regarding external server:*
OPNsense is my main router and a firewall rule is created based on ipsets (using alias with type "External").
So, DNS resolver needs to reside within same machine to fill this corresponding BSD `pf` (Packet Filter) table for ipsets.
---
In dnsmasq you can do:
```
server=/example.com/1.1.1.1 # forward domain example.com to 1.1.1.1 DNS
ipset=/example.com/my_whitelist_alias # whitelisting IPs with firewall rule
```
But this misses forwarding decisions based on client IP - and dnsmasq can't do that to my knowledge.
After more research: dnsmasq at least seems to be able to forward the original client IP via `--add-subnet=32,128`, which is ECS (https://en.wikipedia.org/wiki/EDNS_Client_Subnet). So it might delegate this job to another resolver like BIND.
1. Is os-bind (BIND) plugin mature enough and safe to use? I'd like to not resort to external plugins, where possible - but if that's the way, I am OK with it.
2. Can BIND plugin configure a view based on this original IP delivered over ECS?
3. Alternatively: any experience with starting a second dnsmasq instance manually? Does OPNsense UI provide a way to configure CLI startup/boot scripts?
*Regarding DHCP/VLAN:*
I forgot to add one thing - conditional forwarding should be done for specific clients *and* domains.
Hence DNS server assigned over DHCP or enforced DNAT of all requests to a DNS server is not suitable here.
*Regarding external server:*
OPNsense is my main router and a firewall rule is created based on ipsets (using alias with type "External").
So, DNS resolver needs to reside within same machine to fill this corresponding BSD `pf` (Packet Filter) table for ipsets.
---
In dnsmasq you can do:
```
server=/example.com/1.1.1.1 # forward domain example.com to 1.1.1.1 DNS
ipset=/example.com/my_whitelist_alias # whitelisting IPs with firewall rule
```
But this misses forwarding decisions based on client IP - and dnsmasq can't do that to my knowledge.
After more research: dnsmasq at least seems to be able to forward the original client IP via `--add-subnet=32,128`, which is ECS (https://en.wikipedia.org/wiki/EDNS_Client_Subnet). So it might delegate this job to another resolver like BIND.
1. Is os-bind (BIND) plugin mature enough and safe to use? I'd like to not resort to external plugins, where possible - but if that's the way, I am OK with it.
2. Can BIND plugin configure a view based on this original IP delivered over ECS?
3. Alternatively: any experience with starting a second dnsmasq instance manually? Does OPNsense UI provide a way to configure CLI startup/boot scripts?