What is this WAN setting for?

In the WAN interface there is a setting called "Use DNS servers advertised by peer"

What does this do, I'm assuming it is getting DNS servers from my ISP and unchecking it will allow me to change WAN DNS to say Google?

The next question is if we are already changing the DNS on the LAN interface then or using DHCP option 6, Do I need to make any change to the WAN Interface?

Should I uncheck "Use DNS servers advertised by peer" and leave the DNS feilds blank?

Indifferent. You can ignore resolv.conf emitted from here later in dnsmasq for lan

1 Like

The default is to use your ISP's own DNS servers, as they advertise them in the DHCP lease, PPPoE session, etc. In general, this is a sensible solution (lowest latency, no issues with overlapping jurisdictions, etc.), but if your ISP doesn't do an acceptable job maintaining their DNS servers (ranging from 'just' issues to malicious NXDOMAIN hijacking or unwanted filtering), there can be reasons to use different ones.

"Use DNS servers advertised by peer" now decides what your OpenWrt router itself is using - and indirectly offering to your clients via its dnsmasq instance. Usually it is best to hook in your preferred alternative DNS servers here, so dnsmasq (and with that local DNS resolution, adblock, etc.) keeps working as normal (just referring to alternative upstream DNS servers).

Option 6 instead tells your lan clients to use the specified DNS server directly, without the router in the loop. You lose caching (speed-up), local DNS resolution and adblocking (if installed/ configured) that way.

There are reasons for either of these alternatives, depending on your requirements.

1 Like

That option does not do what you think it does.

In my setup I do not care what DNS servers the router itself gets so happy to leave WAN settings as default, which makes sense.

I run my own DNS server on my NAS and want the router's DNS bypassed entirely, so opted to use DHCP option 6, which looks like the correct way from what you described.

Then what is the purpose of LAN Interface > Advanced Settings > "Use custom DNS servers"?

Does that not change just the upstream DNS servers for the LAN interface, but clients will still use the router as the DNS, why have this option when you can do the same on the WAN interface?

1 Like

dnsmasq forwarders should point to your own dns, openwrt will cache some lru list. If you want to account per client override dhcp dns option with your dns server ip

1 Like

Not sure what you're trying to say here, that's exactly what I've done?

Just trying to get better understanding on what each option does and when to use it.

Dhcp puts dns servers in resolv.conf then dnsmasq reads that. You can complement or replace list in either place.