Setting a DNS address to use for all VLANS/interfaces

I have been working at this for over a week now, can't seem to figure it out.

I have 6 VLANS + WAN. I set each interface to use my local DNS's that I have set up on VLAN 40.
DNS 1: 10.0.40.5
DNS 2: 10.0.40.4

Putting these addresses in the interface of each VLAN and WAN, seem to have 0 effect. How do I know? Glad you asked, I can turn both DNS servers off, and still access ANY domain, random google, random link click and it works. Also, my DNS servers are rsync'd every night, and have the same DNS re-writes, and my DNS rewrites do not work.

The only way I have been able to get traffic to use my local DNS's, is by running a port forward rule, forcing all traffic to 10.0.40.5 port 53. That works fine, but if I am working on that server and have to reboot, I need failover to 10.0.40.4 port 53, which won't happen, cause its port forwarding.

I am very frustrated with this. I would be grateful for any help at all.

Make dnsmasq forward all requests to your local servers and disallow the use of any other available upstream DNS servers.

uci add_list dhcp.@dnsmasq[0].server='10.0.40.5'
uci add_list dhcp.@dnsmasq[0].server='10.0.40.4'
uci set dhcp.@dnsmasq[0].noresolv='1'
uci commit dhcp
/etc/init.d/dnsmasq restart

https://openwrt.org/docs/guide-user/base-system/dhcp#all_options

1 Like