DD-WRT MyDNS Firewall setup

Share This!

DD-WRT DNS Firewall Introduction


Unfortunately, certain devices such as the Google Chromecast have built in DNS settings designed to redirect all DNS queries to a particular server. To circumvent this, we’ll need to set up a firewall on your router that will instead push all DNS queries to use MyDNS.

While many routers in the market allow you to set up manual DNS servers on them, unfortunately many don’t allow you to set up a custom firewall.

From our experience, the best routers that give you full customisation are DDWRT based routers. This guide will walk you through setting up a DDWRT router to use a firewall to restrict all outgoing DNS queries and push them to use MyDNS servers instead.


Before we begin, we’d just like to inform you that while the firewall rules listed in this guide can theoretically be used on any router(even those that are not set up to use DDWRT firmware) we have only tested this rule on a handful of routers and so we can’t confirm that it will work on all routers on the market.


Chromecast DD-WRT Firewall setup

Login to your DDWRT router user interface and click on Setup. In this example, our DDWRT’s IP address is 192.168.1.1

ddwrt-user-interface

You might be prompted to enter your router’s credentials if you had not logged in to the router prior to this.

ddwrt-router-credentials

Click on the Administration tab and on the Commands tab.

In the Commands box, enter the following firewall rule:

iptables -I PREROUTING -t nat -p udp -d 8.8.8.8 –dport 53 -j DNAT –to-destination 119.81.72.65

iptables -I PREROUTING -t nat -p udp -d 8.8.4.4 –dport 53 -j DNAT –to-destination 113.20.28.16

Note: The above destination IP address are only an example, please use the DNS addresses that you took note earlier from our website.

ddwrt googledns firewall rule

Now click on Save Firewall to apply and save the settings.

This will now ensure that all Google DNS (8.8.8.8, 8.8.4.4) queries sent from any device on your network will be redirected to use the DNS addresses you’ve set in the rule above.


Any Problems?

 

Unfortunately it doesn’t always go to plan!

 

If you have any problems or can’t get connected, please email us at [email protected]. We’ll get back to you as soon as possible and try to help