Add Google DNS servers as VIPs to loopback interface on local DNS server
Add static routes on router to redirect traffic towards them
(192.168.0.108 is my local DNS server)
Then test!!
I’ve added the routes on a single host because I
can’t add static routes on the superhub, but the principle is the same and it
did work on my previous router.
You can tell it’s working by sending a request for an internal hostname to “Google DNS” which proves your local DNS is resolving the request and not sending it out to public DNS. Also a traceroute shows traffic is being routed to your local DNS..
If it doesn’t work couple of things to check.
- Make sure local DNS server is configured to respond to requests on all interfaces
- Check if IP forwarding is enabled on DNS server
- cat /proc/sys/net/ipv4/ip_forward
- It is set on my server but can’t remember if it was enabled to make this work or not.
- Check if RP filter is set to loose (2) on eth0 & lo interfaces. This might be required to get it to work.
- cat /proc/sys/net/ipv4/conf/lo/rp_filter
- cat /proc/sys/net/ipv4/conf/eth0/rp_filter
- Again this is set on my server but don't remember why it got set.
- Of the 2 suggestions above, Co-Pilot suggests RP filter is the one that is probably needed.