CLI or file edit equivalent to LUCI clearing the “Use DNS servers advertised by peer” checkbox

I'm trying to prevent the prevent the upstream DNS servers passed through upstream DHCP from getting written to /tmp/resolv.conf.auto.

Of course will be replaced with an alternative by editing /etc/config/network:

config interface 'wan'
        option ifname 'eth0'
        option proto 'dhcp'
        option dns '192.168.1.20'     <---- I added this

so that '192.168.1.20' appears in /tmp/resolv.conf.auto. (Already tested and present in /tmp/resolv.conf.auto in addition to upstream DNS servers propogated via upstream DHCP.)

From reviewing forum discussions I now that it is possible via the LUCI interface unchecking a box labelled ''Use DNS servers advertised by peer".

However, I can't do that or see its effects because I had to remove LUCI in order to install nftables NAT functions. So I am asking here.

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

4 Likes

My friend mean't to put this on top of the above.... ^

( edit: not /lib/functions/network.sh ! )

source /etc/profile

Couldn't find any reference to peerdns or peer anywhere under /lib/functions/ so I'm unclear what information you are giving or how it addresses the question.

1 Like

fixed!

source /etc/profile

necessary when running above commands ( service ) from script!

2 Likes

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.