0

Is there anyway to force computers to use a specific DNS? Even if a computer has a defined a DNS address that I don't want, all of its DNS traffic from it will be resolved using the specific DNS. I guess I'm trying to say is there a way to emulate a proxy so to speak with out making one.

The whole reason why I'm doing this is that I use OpenDNS for web filtering but the only thing that you need to do to bypass that is just type in a different DNS server in Windows.

One idea could be to somehow use a Captive portal to stop web traffic until the user has the correct DNS server. I don't know how to use a captive portal to check a DNS setting though...

Any ideas would be great. Thanks.

7 Answers 7

9

If you want you computers on your LAN to only permitted to use a specific DNS server you need to block UDP port 53 outgoing on your firewall to all IP addresses along with adding rules to explicitly permit the IPs of the "allowed" DNS servers.

If your users want to get around that they'll just run a VPN tunnel to an off-site box and get DNS from there. You can try and block that, too, but they'll just fight you another way. (After all, you can tunnel IP over DNS if you really want to! Heh heh...)

Your efforts aren't pointless, but you will have to fight an arms race that, by definition, no one can possibly win, if you want to stop everybody. Blocking DNS queries to J. Random DNS server will stop the average person.

1
  • Alright thanks guys I will try this out. :) I guess I need to read up on the common ports and see what they do. Aug 8, 2009 at 15:58
2

If it's an option for you, only a member of the administrator group can change a network adapter settings. Assign the DNS address by DHCP and make them a standard user and you should be ok.

1

The best user experience would be to hijack anysourceip:53 to go to your :53 with a firewall rule to forward requests.

If you block port 53, the end user with a custom dns will not be getting domain name resolution, and could cause a poor user experience. While if you redirect it, they will be getting online without calling in customer support, or the IT admin. It will reduce support time, and if that costs money, it will save money.

If you're using microtik in /ip firewall nat

add chain=dstnat action=dst-nat to-addresses=192.168.88.1 to-ports=53 protocol=tcp dst-port=53 
add chain=dstnat action=dst-nat to-addresses=192.168.88.1 to-ports=53 protocol=udp dst-port=53 

src: http://wiki.mikrotik.com/wiki/Force_users_to_use_specified_DNS_server

1
  • I know tech savvy can bypass this, but the likely hood of a tech savvy user calling in to tech support are extremely low, as they would have figured this out and changed ports, or noticed a captive portal in place. This just gets people online, and using your openDNS or other preferred DNS.
    – Clown Man
    Aug 8, 2015 at 0:39
0

If you are looking to prevent users on your network from some other dns server you will need to block access at the firewall. If you do that you will need to provide a dns server that you allow to have outside access. Any dns server can be used to proxy dns requests.

Some like dnsmasq are designed for the task. M0n0wall uses it for exactly that reason.

It wont stop everyone but it will allow you better control.

0

You need to block DNS (port 53) from all servers except the one you intend to use.

Easiest solution I can think of would be to install something like IPCop, SmoothWall, Monowall, pfSense (all FREE) on a spare PC (very low system requirements) and run an actual PROXY.

That's essentially what you're wanting to do... emulate a proxy without making one. ;-)

Installing something like IPCop is pretty painless, has Squid proxy built in, you can add URLFilter for free, then run the whole thing as a transparent proxy. Problem solved.

But all that aside... what you're looking to do is block port 53 to all IPs except for the OpenDNS servers.

As Evan mentioned, its not going to make it IMPOSSIBLE... but its going to keep the majority out. ;-)

Hope this helps.

0
0

Within your LAN you could put up a DHCP serving the DNS you want. All DHCP enabled clients would go with yours. If there is already a DHCP server out there, just make sure you answer quicker, or do some ARP poisoning/spoofing.

0

I think this is what I'm going to do, I already have tomato firmware on my linksys router so I'm going to set the DDNS to opendns and then check the box that says intercept DNS port udp 53. I think that should work.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .