What's new

Why is the addn-hosts being ignored when assigning DNS server?

  • 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!

Frank Herman

Occasional Visitor
In dnsmasq.conf.add, the following (2) commands;

-> conf-file=/jffs/configs/domains.txt

-> addn-hosts=/jffs/configs/hostnames.txt

are being ignored, after I add this command;

-> dhcp-option=option:dns-server,8.8.8.8,8.8.4.4

If I remove the dhcp-option command, the domain and host file assignments work fine.

I'd like to have both working together, is this possible?
 
Because you're telling the client to bypass the DNS server on the router and go directly to 8.8.8.8 and 8.8.4.4.

Why is the router capable of adding the "domains.txt" and the "hostnames.txt" re-directions to the DNS server (OpenDNS) configured in the router?

I'd like to do the same thing, within the dnsmasq.conf.add file, is this not possible?
 
"dhcp-option=option:dns-server,8.8.8.8,8.8.4.4" is a DHCP client directive. You're telling the DHCP client to use 8.8.8.8 and 8.8.4.4 instead of the router's DNS server (192.168.1.1).

If you want to use addn-hosts you need the client to use the router's DNS server. If the router's DNS server can't resolve the name it will forward it upstream to the servers defined in resolv-file (your router's WAN DNS).
 
"dhcp-option=option:dns-server,8.8.8.8,8.8.4.4" is a DHCP client directive. You're telling the DHCP client to use 8.8.8.8 and 8.8.4.4 instead of the router's DNS server (192.168.1.1).

If you want to use addn-hosts you need the client to use the router's DNS server. If the router's DNS server can't resolve the name it will forward it upstream to the servers defined in resolv-file (your router's WAN DNS).

That's too bad, I am trying to implement an ad block & a safe search installation onto my network (ad blocking using addn-hosts and safe search using DNS server re-direction).

I can make them work independent of each other, but not together. Are there any other ways to accomplish this?
 
I can make them work independent of each other, but not together. Are there any other ways to accomplish this?
Yes, this is really straight forward. It's how most of the ad-blocking solutions in these forums work. Leave the LAN DHCP settings alone and the clients will default to using the router's DNS.
 
Yes, this is really straight forward. It's how most of the ad-blocking solutions in these forums work. Leave the LAN DHCP settings alone and the clients will default to using the router's DNS.

I thought you had to redirect to another DNS server in order to get the safe search restrictions to work?

Do you have an example dnsmasq.conf file for the configuration you mentioned?
 
I thought you had to redirect to another DNS server in order to get the safe search restrictions to work?
I'm assuming that's what you're doing in your conf-file and/or addn-hosts.

Do you have an example dnsmasq.conf file for the configuration you mentioned?
I don't have an example because it's not something I use. But there have been threads about this in the past. If you search the forums I expect you'll be able to find them.
 
If you want to use DNSFilter, then have it set to force clients at the router. Then, implement your desired settings in dnsmasq.
 
If you want to use DNSFilter, then have it set to force clients at the router. Then, implement your desired settings in dnsmasq.

I tried searching the forums, I am finding posts on “safe searching” which is adding the applicable YouTube and Google restrictions (depending on Mac id’s) and separate posts on ad blocking. But no posts with both of them working together on the same network.

When I enable DNS filtering, my client Youtube and Google restrictions stop working, so I can’t use that approach. The router (RT-N66U) is overwriting something on me.

If you have a link that can tell me how to get both working, that would be fabulous!
 
Last edited:
I tried searching the forums, I am finding posts on “safe searching” which is adding the applicable YouTube and Google restrictions (depending on Mac id’s) and separate posts on ad blocking. But no posts with both of them working together on the same network.

If you have a link that can tell me how to get both working, that would be fabulous!

Is this topic post in the forum helpful?

Forcing restricted mode for youtube and google search
 

Unfortunately, I need to add in another layer, like this;

Client MAC id 11:22:33:44:55:aa, needs safe search restrictions + ad blocking (via domain.txt & hosts.txt reference files)

Client MAC id 11:22:33:44:55:bb, no safe search restrictions + ad blocking (via domain.txt & hosts.txt reference files)

Client MAC id 11:22:33:44:55:cc, no safe search restrictions + no ad blocking (via domain.txt & hosts.txt reference files)

I didn't see where the MAC id's and ad blocking get added to the DNS Filtering section of the GUI? I may be taking on a little too much with this project, since the only thing I can get working is either the safe searching (youtube & google) or the ad blocking, but not both. :(

I scoured the internet and haven't found anything showing that this is even possible??
 
Last edited:

Similar threads

Latest threads

Sign Up For SNBForums Daily Digest

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