Page 1 of 1
Using LAN IP to route to different DNS?
Posted: Mon Feb 25, 2013 6:58 pm
by dirtmover
I'd like to be able to route to different DNS servers based on IP or MAC i.e.
- I've got a couple of media devices I'd like to route to Unotelly
- I'd like to route all the kids devices to OpenDNS
- and all other devices to my ISP's DNS servers
Finally I'd like to enforce these settings so that users can't provide there own DNS servers.
Is this possible?
Re: Using LAN IP to route to different DNS?
Posted: Wed Feb 27, 2013 8:54 am
by dirtmover
Come on guys, don't be shy!
OK, maybe you just like a challenge so to get you started here is what I have so for.
- I've defined a range of IP addresses that I wish to protect with OpenDNS (192.168.0.96/27 = 192.169.0.97 - 192.169.0.127)
- For the devices that I want to protect I get the router to assign addresses in the above range based on MAC and enforce this so that the users can't set their own IP.
- In the firewall I defined iptables rules to route any port 53 activity (DNS) to OpenDNS. These rules will be applied regardless of any DNS server settings
- I configured Gargoyle with my ISP DNS settings buy allow clients to use their own
- Media devices are configured separately to point to the Unotelly DNS servers
The only thing I don't like about the above solution is that there is no way to provide the protected subnet with a secondary DNS server.
Now I've got the ball rolling maybe someone can come up with a better solution. I'm wondering if dnsmasq may be helpful here?
Re: Using LAN IP to route to different DNS?
Posted: Wed Feb 27, 2013 2:03 pm
by psycik
I managed to do it the other way....depending on the domain to be accessed, use this nameserver...
In my case an app on my iphone was going through the unblockus DNS servers - and breaking as it was blocked by my country.
In the dnsmasq.conf file I added an entry that when accessing content from this site, use my ISPs DNS server.
http://www.geekzone.co.nz/davidcole/8351
Re: Using LAN IP to route to different DNS?
Posted: Wed Mar 06, 2013 5:14 am
by pelowj
Connection > Basic > "Force Clients To Use Router DNS Servers"
At least answers part of your question.
-jp