Bypass provider DNS

Hello,
I have Netgear WAX206 on OpenWrt 23.05.3 set as main router connected to provider's Fritzbox 5530 (cascade connection). I'm trying to bypass the DNS provided by the provider, I've set them on both LAN and WAN interfaces under "Use custom DNS servers". Then I've tryed to vi /etc/config/dhcp with the following (to force another DNS for the MAC of my pc)

config tag 'tag1'
option dhcp_option '6,9.9.9.9,8.8.8.8'

config host
option name 'myself'
option mac 'xX:xx:xx:xx'
option tag 'tag1'

But neither my PC nor the others connected to the lan get one of the spefied DNSes.
I'm not an expert...
Thanks in advance

Tried not using the tag ?

https://openwrt.org/docs/guide-user/base-system/dhcp_configuration#dhcp_options

You mean to set option

dhcp_option '6,9.9.9.9,8.8.8.8'

with no tag and without host will affect everyone?
Did I understand well?
Thanks

Correct...

Try this

list dhcp_option '6,9.9.9.9,8.8.8.8'
1 Like

Thanks, but in what "section" of the /etc/config/dhcp should I place it? I see there are "blocks" starting with "config dhcp" or config "odhcpd".. I mean, under LAN, WAN or DNSMASQ section of the file?
Thanks

Since you already did your config, isn't it there ?

I mean, the dhcp have different "config", LAN,WAN, ODHCPD and DNSMASQ. I've added the config "tag1" but you told me I can not use the tag, so I can add the option directly under the "config lan"?

Just use the commands from the link, and you'll be fine ?

You need to add alternate servers to dnsmasq as forwarders, if that is intercepted you need doh proxy or dot proxy stubby or dnscypt proxy and set chosen proxy as forwarder.

It is list tag 'tag1'

See https://github.com/egc112/OpenWRT-egc-add-on/tree/main/stop-dns-leak#option-6

The first section of the link " DHCP options " seems to add this to LAN section, the second to specific TAG. Since you said to remove the tag I will add to lan section. LEt's see

I've added

config tag 'tag1'
option dhcp_option '6,8.8.8.8,8.8.4.4'

config host
option name 'user00'
option mac 'xxxxxxxx'
list tag 'tag1'

but doesnt work. Nor putting only "list dhcp_option '6,208.67.222.123,208.67.220.123' " under the LAN config.. :frowning:

How about you follow the wiki next ?

maybe because I'm trying to, but dont get what i've done wrong

1 Like

The sections you inserted exist on their own. Don't add your lines to an existing section.

Substitute these lines

config tag 'tag1'
option dhcp_option '6,9.9.9.9,8.8.8.8'

config host
option name 'myself'
option mac 'xX:xx:xx:xx'
option tag 'tag1'

with the following lines

config tag 'tag1'
   list dhcp_option '6,9.9.9.9,8.8.8.8'

config host
   option name 'myself'
   option mac 'xX:xx:xx:xx'
   option tag 'tag1'

Just place these lines at the end of your file /etc/config/dhcp. It should work as desired.

Alternatively you can rig dnsmasq to connect alternate DNS servers and leave LAN dhcp untouched.

/etc/config/dhcp
config dnsmasq
.....
        option noresolv '1'
        list server '/use-application-dns.net/'
        list server '/mask-h2.icloud.com/'
        list server '/mask.icloud.com/'
        list server '1.1.1.2'
        list server '1.0.0.2'

Unfortunately i'm still pointed to provider's dns even with that config
Regards

i've added the section exacly like specified, and then restarted dnsmasq, but I still point to provider's dns. Is there something specific to be done to get this running (restard the router or other)? Or its simply not working in my case?

who is "I" ?
how/where are you seeing it ?

it's working unless your ISP's intercepting your requests, or you messed up.