Cant seem to get a persistent DNS setting

If I manually edit the dns /resolv.conf file it works well but changes after a few seconds make to using local host

root@OpenWrt:~/openwrt-scripts# cat /etc/resolv.conf
search lan
nameserver 127.0.0.1
nameserver ::1
root@OpenWrt:~/openwrt-scripts# cat /tmp/resolv.conf.d/resolv.conf.auto
# Interface wan6
nameserver 2606:4700:4700::1001
# Interface lan
nameserver 208.67.222.123
nameserver 208.67.220.123
# Interface wan
nameserver 1.1.1.1
root@OpenWrt:~/openwrt-scripts# ping google.ca
^C DONT WORK :(

root@OpenWrt:~/openwrt-scripts# cat /etc/config/network

config interface 'loopback'
        option device 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'

config globals 'globals'
        option ula_prefix 'fdd3:3ab7:25b4::/48'

config device
        option name 'br-lan'
        option type 'bridge'
        list ports 'lan2'
        list ports 'lan3'
        list ports 'lan4'

config interface 'lan'
        option device 'br-lan'
        option proto 'static'
        option ipaddr '192.168.1.1'
        option netmask '255.255.255.0'
        option ip6assign '60'
        option peerdns '0'
        list dns '208.67.222.123'
        list dns '208.67.220.123'
        option dns_metric '254'

config device
        option name 'wan'
        option macaddr 'x'

config interface 'wan'
        option device 'wan'
        option proto 'dhcp'
        option peerdns '0'
        list dns '1.1.1.1'
        option dns_metric '255'

config interface 'wan6'
        option device 'wan'
        option proto 'dhcpv6'
        option dns 'publicdbs'
        option peerdns '0'

and we can't fix a "DONT WORK"....

please learn to use the code wrapping button - </>.

What is it exactly you want?

By default DNSMasq hands out the routers address to your lan clients.

DNSMasq itself uses the upstream DNS servers you added to the interfaces and which are placed in /tmp/resolv.conf.d/resolv.conf.auto

The order does not matter unless you added strict-order and even then it does not work reliably.

See my personal notes about how DNSMasq works : https://github.com/egc112/OpenWRT-egc-add-on/tree/main/stop-dns-leak#how-dnsmasq-works-in-openwrt

basically cant get dns resoultion on the router itself , and need a persistent way of doing that !

basically cant get dns resoultion on the router itself , and need a persistent way of doing that ! so I can install packages etc.

assuming you're not using ipv4 only, what's publicdbs ?

1 Like

its juts a public dns server , the issue is my resolv.conf will not populate after rebooting

are you able to revolve that name ?

can you ping any of the IPs you've listed above, from the router ?

then I guess the list above is DIY ?

while you're connected via ssh, please post the output of ubus call system board too.