1
I have always used dnsmasq to point a subdomain to my local dev machine at the router/network level.
address=/dev.example.com/192.168.1.80
I have now setup two vlan interfaces for other purposes (i.e. guest network). I need to be able to use different nameservers on each lan, which I also accomplished using dnsmasq.
dhcp-option=br0,6,208.67.222.123,208.67.220.123
dhcp-option=br1,6,208.67.222.222,208.67.220.220
dhcp-option=br2,6,208.67.222.123,208.67.220.123
However, once this configuration is in place, the address
directive no longer works. It appears this dhcp config will be used for dns resolution above everything else, so requests for the dev subdomain reach out to the internet rather than my local ip as before. For good measure, I have tried moving the address directive before and after the dhcp config. It makes no difference.
Is there a way to assign per interface dns servers and use the address directive, or to accomplish the same behavior some other way?
In case it helps, I am using AdvancedTomato firmware.
1Those local hosts won't resolve unless you use the dnsmasq machine as DNS server. So for example, you could set br0's DNS server to 192.168.1.1 (assumed) and local hosts will resolve on br0 only. – multithr3at3d – 2018-01-16T05:14:42.933
@multithr3at3d You are correct! Would you like to post that as an answer with the corrected config? I just added the interface's ip (which you guessed correctly) as the first ip in the list for that interface's nameservers. – m59 – 2018-01-16T13:48:46.203