If IP connections work but names fail, sign in over SSH from a wired LAN port. Leave DNS alone if only the LuCI menu is missing and names resolve.
Compare two lookups
This assumes IPv4 DHCP and stock dnsmasq. Replace every 192.0.2.53 with an approved resolver. The example address is reserved for documentation. If both lookups fail, check routing and DNS reachability. Continue only if the explicit lookup alone works. Check split or encrypted DNS separately.
uci get network.wan.proto
uci changes network
uci -q get network.wan.dns
ubus call network.interface.wan status
nslookup openwrt.org
nslookup openwrt.org 192.0.2.53

Try the change without saving
Look for dhcp and up set to true. Note dns-server. Stop for pending edits, existing custom DNS or an existing backup of the same name. Reload can interrupt WAN and SSH offers no timed undo. Stay on the LAN. The screenshots use two isolated 25.12.6 VMs with synthetic answers from 10.0.2.2. Disabling peerdns ignores DNS from the IPv4 lease.
DNS=192.0.2.53
[ "${DNS%.*}" != 192.0.2 ] && [ ! -e /root/network.before-dns ] &&
cp -p /etc/config/network /root/network.before-dns &&
uci set network.wan.peerdns=0 &&
uci add_list network.wan.dns="$DNS" &&
/etc/init.d/network reload

uci changes network
ubus call network.interface.wan status
nslookup openwrt.org
Can a LAN client resolve names too?
Wait for WAN, check the new dns-server and look for the expected answer. A local Server address is normal. Run this on a PC using the router’s LAN IP. Repeat with an uncached name and an internal name. If only the PC fails, check the LAN listener and firewall. WAN6 and VPNs can still supply other resolvers.
nslookup openwrt.org 192.168.1.1
Choose one ending. For a failed or temporary test, run this rollback only if these are the only edits. It discards all pending network changes. Confirm an empty change list and the old DNS.
uci revert network && /etc/init.d/network reload
uci changes network
ubus call network.interface.wan status

To keep a successful change, skip rollback, inspect all edits and run uci commit network. Retest after renewal. To undo a saved change if nothing else changed, run cp /root/network.before-dns /etc/config/network && /etc/init.d/network reload and test both ends again.
Comments