What's new

Need help with custom DNS per DHCP client

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

mrvoidman

New Around Here
Hi, I have a RT-N66U and I want to apply some controls on my kids' tablet connections but not to other computers on my network.
This is what I'd like to do for specific connections on my network:
1. Assign a custom DNS server (OpenDNS FamilyShield)
2. Filter web traffic through Privoxy
3. Block specific web-sites at specific times
4. Block internet at specific times

For #2 I found this link but are the others possible?

Thank you!
 
Hi, I have a RT-N66U and I want to apply some controls on my kids' tablet connections but not to other computers on my network.
This is what I'd like to do for specific connections on my network:
1. Assign a custom DNS server (OpenDNS FamilyShield)
2. Filter web traffic through Privoxy
3. Block specific web-sites at specific times
4. Block internet at specific times

For #2 I found this link but are the others possible?

Thank you!

Excellent timing! I just did option #1 myself. You get to play with the dnsmasq.conf file. Not sure how familiar you are with linux commands so I'll give you the how to and if you need help ask from there.

My situation is such that I want opendns on the kid's tablets and computer (and be able to block types of sites through the opendns account) but leave the other systems in the house to use my dns of choice (google in my case).

Enable ssh access in "Administration / System" tab.

Set the global DNS in the "WAN / Internet Connection" tab (this is the DNS you don't want your kids to use).

Enable the jffs partition under the "Administration/System" tab. If you've not done this before be sure to check the "Format JFFS partition at next boot" and reboot.

Now ssh in to the router and make the file /jffs/configs/dnsmasq.conf.add (this file will append whatever you put in it to the end of /etc/dnsmasq.conf when you reboot).

Add this to the file (this uses the opendns dns address).

Code:
dhcp-mac=newdns,XX:XX:XX:XX:XX:XX
dhcp-mac=newdns,YY:YY:YY:YY:YY:YY
dhcp-option=newdns,option:dns-server,208.67.222.222,208.67.220.220

Where XX:XX:XX:XX:XX:XX and YY:YY:YY:YY:YY:YY are the MAC addresses of the devices you want to use the alternative dns. You can add as many as you want using that same format format. You can also change that "newdns" to anything you want. It's simply a label you are giving to those MAC addresses.

Essentially, you are telling the router "anytime you see MAC address XX:XX:XX:XX:XX:XX or YY:YY:YY:YY:YY:YY, give it the newdns label."

The dhcp-option line is then saying "use 208.67.222.222 and 208.67.220.220 as the dns for anything with the newdns label".

These are the commands I used:

Code:
touch /jffs/configs/dnsmasq.conf.add
echo "dhcp-mac=newdns,XX:XX:XX:XX:XX:XX" >> /jffs/configs/dnsmasq.conf.add
echo "dhcp-mac=newdns,YY:YY:YY:YY:YY:YY" >> /jffs/configs/dnsmasq.conf.add
echo "dhcp-option=newdns,option:dns-server,208.67.222.222,208.67.220.220" >> /jffs/configs/dnsmasq.conf.add

Reboot and you are good to go! If you then look at your /etc/dnsmasq.conf file you'll see your additions at the end. If you delete the /jffs/configs/dnsmasq.conf.add file then reboot your additions will be gone.
 
Excellent timing! I just did option #1 myself. You get to play with the dnsmasq.conf file. Not sure how familiar you are with linux commands so I'll give you the how to and if you need help ask from there.

My situation is such that I want opendns on the kid's tablets and computer (and be able to block types of sites through the opendns account) but leave the other systems in the house to use my dns of choice (google in my case).

Enable ssh access in "Administration / System" tab.

Set the global DNS in the "WAN / Internet Connection" tab (this is the DNS you don't want your kids to use).

Enable the jffs partition under the "Administration/System" tab. If you've not done this before be sure to check the "Format JFFS partition at next boot" and reboot.

Now ssh in to the router and make the file /jffs/configs/dnsmasq.conf.add (this file will append whatever you put in it to the end of /etc/dnsmasq.conf when you reboot).

Add this to the file (this uses the opendns dns address).

Code:
dhcp-mac=newdns,XX:XX:XX:XX:XX:XX
dhcp-mac=newdns,YY:YY:YY:YY:YY:YY
dhcp-option=newdns,option:dns-server,208.67.222.222,208.67.220.220

Where XX:XX:XX:XX:XX:XX and YY:YY:YY:YY:YY:YY are the MAC addresses of the devices you want to use the alternative dns. You can add as many as you want using that same format format. You can also change that "newdns" to anything you want. It's simply a label you are giving to those MAC addresses.

Essentially, you are telling the router "anytime you see MAC address XX:XX:XX:XX:XX:XX or YY:YY:YY:YY:YY:YY, give it the newdns label."

The dhcp-option line is then saying "use 208.67.222.222 and 208.67.220.220 as the dns for anything with the newdns label".

These are the commands I used:

Code:
touch /jffs/configs/dnsmasq.conf.add
echo "dhcp-mac=newdns,XX:XX:XX:XX:XX:XX" >> /jffs/configs/dnsmasq.conf.add
echo "dhcp-mac=newdns,YY:YY:YY:YY:YY:YY" >> /jffs/configs/dnsmasq.conf.add
echo "dhcp-option=newdns,option:dns-server,208.67.222.222,208.67.220.220" >> /jffs/configs/dnsmasq.conf.add

Reboot and you are good to go! If you then look at your /etc/dnsmasq.conf file you'll see your additions at the end. If you delete the /jffs/configs/dnsmasq.conf.add file then reboot your additions will be gone.

Is there any where I need to set my open dns account? Or just the info above will do?
 
Is there any where I need to set my open dns account? Or just the info above will do?

Are you already using opendns? If not, set up a free account. The free one is still really powerful. That's what I use.

Go to http://dnsomatic.com/ and log on to your opendns account (dnsomatic is a part of opendns). The great thing about dnsomatic is you can have multiple dynamic dns services updated from this one spot. When you enter your account information in to your router it will use dnsomatic to associate your opendns account with your network's IP address.

On the router go to the "WAN / DDNS" tab. Set it up like this:

Enable the DDNS Client: Yes
Server: WWW.DNSOMATIC.COM
Host Name: all.dnsomatic.com
User Name or E-mail address: (this is your dnsomatic logon)
Password or DDNS Key: (this is your dnsomatic password)
Enable wildcard: (this is up to you. For me it is "No")

Apply.

This is great because in my case I use opendns for the kids system dns control and no-ip.com as a set address I can use to log in to my systems remotely. Dnsomatic keeps both services up to date if my internet provider changes my IP address.

Once all this is done, on your system go to the following link:

http://welcome.opendns.com/

You should get a bit "oops" message stating your are not using opendns. Then on your kid's system go to the same site. It will let you know you ARE using it.

Also, in your router settings look at parental controls. It has some good time restrictions that you can set by mac address.
 
These are the commands I used:

Code:
touch /jffs/configs/dnsmasq.conf.add
echo "dhcp-mac=newdns,XX:XX:XX:XX:XX:XX" >> /jffs/configs/dnsmasq.conf.add
echo "dhcp-mac=newdns,YY:YY:YY:YY:YY:YY" >> /jffs/configs/dnsmasq.conf.add
echo "dhcp-option=newdns,option:dns-server,208.67.222.222,208.67.220.220" >> /jffs/configs/dnsmasq.conf.add

Reboot and you are good to go! If you then look at your /etc/dnsmasq.conf file you'll see your additions at the end. If you delete the /jffs/configs/dnsmasq.conf.add file then reboot your additions will be gone.

Hello Lost Gog!

I followed your HowTo info, but after reboot my Wi Fi devices can not connect anymore to the rooter. I'm using RT_N66U_3004374.36_beta1. There is another option to do this, but with the same result?

Thx!
 
Hello Lost Gog!

I followed your HowTo info, but after reboot my Wi Fi devices can not connect anymore to the rooter. I'm using RT_N66U_3004374.36_beta1. There is another option to do this, but with the same result?

Thx!

The code here does nothing to affect wifi. It simply changes the dns used for the designated MAC addresses. I think there is something else going on if you're seeing a problem with connection.
 

Similar threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top