Setting Up DD-WRT

dns4me Guides - Setting Up DD-WRT

While on the "DD-WRT" wireless network open your web browser and goto http://192.168.1.1

When you first connect to the DD-WRT admin interface you will have to set a router Username and password, just set these both to admin for now as we are going to reset the settings anyway.

Click on "Administration" then "Backup"

Download the following settings file, then click the Choose file button and select the "dns4me.bin" file you just downloaded

Click "Restore", once the process has complete you will need to connect to the "dns4me-wifi" network and in your web browser go to http://192.168.2.1

Click on "Administration" (use admin for both username and password) then "Commands" click "Edit" underneath the firewall commands

The 3 important lines are:

iptables -I PREROUTING -t nat -p udp --dport 53 -j DNAT --to-destination 192.168.2.1
wget -O /etc/hosts http://dns4me.net/index.php/user/hosts_file_api/GUID
restart_dns

I will explain each so you understand whats going on here.

iptables -I PREROUTING -t nat -p udp --dport 53 -j DNAT --to-destination 192.168.2.1
This basically adds a firewall rule to forward any request sent to port 53 (the DNS port) to the routers IP, we do this in case any applications have hardcoded DNS settings.
wget -O /etc/hosts http://dns4me.net/index.php/user/hosts_file_api/GUID
This command downloads your latest raw host file and saves it to /etc/hosts.
restart_dns
We need to restart the DNS service to make sure our hosts file is applied.

Ok we now need to update the firewall script with your GUID go to "User Console" > "Host File Generator" on the dns4me website.
Click the "Show Raw Host File API URL" and copy the last section of the URL (we cant use the actual URL as DD-WRT doesen't support HTTPS), the GUID will look like XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
Paste this over the GUID text in the firewall commands in DD-WRT.

Click "Save Firewall"

To ensure the fastest possable streams we want to use either your local router DNS or your ISP's DNS, so Click "Setup" > "Basic Setup" then change the local DNS from 8.8.8.8 to either your routers IP or your ISP (internet service provider) DNS.
Click "Save" then "Apply Settings"

Ok now onto the final touches click here to secure your device