OpenWrt 23.10.1 on TP-Link Archer C7 v2 - DHCP config generation/parsing issue (ipcalc?) disguised as DNS issue

I flashed from a working 23.05.5 to 24.10.1 using the appropriate squashfs-sysupgrade.bin

After the upgrade, name resolution was broken. Doing an nslookup specifying the server (e.g. nslookup openwrt.org 1.1.1.1) worked fine.

The error message was something along the lines of '127.0.0.1#53 access denied' - sorry for no further details, but I had to rush to downgrade back to 23.05.5 to enable service for others (factory reset, reapply saved configs).

Has anyone else experienced such a problem and found a solution, or do I need to recreate the problem in a quiet period to get some further information to aid debugging?

This was on the router, right ?

This sounds like you have additional dns packages.
First do upgrade with auc -n -y
Download all packages included sys(down)upgrade file and repeat command with parameters removed.
Save config backup (you know the drill)
Now auc -n -y -B 24.10
Remove yn parameters to upgrade.
Show logread -e dns after 24.10 boot if anything is wrong. Revert while we figure out?
No it is not typical to break on supported upgrade typically one major version up.
Also 24.10.0 ... 24.10-SNAPSHOT can be swapped back and forth if nreded.

1 Like

It is from dnsmasq to one of filtering dns systems.

Yes, this was on the router.

Clients simply timed-out/failed.

Thank you for the advice and clear list of things to follow up/try. I shall do so when there aren't any users breathing down my neck.

This router is one of several that have been upgraded over the years, so there could well be some cruft in the configs, and time to start afresh from a new factory image. OpenWrt has been so reliable in the upgrades that I've become lazy.

1 Like

OK, for those with little experience (and that includes me),

# auc -n -y
-ash: auc: not found

so, first of all make sure the auc package ( CLI client for attended-sysupgrade ) is installed.

In my case, using the Luci GUI, I get:

#### Executing package manager

Installing auc (0.3.2-1) to root... Downloading https://downloads.openwrt.org/releases/23.05.5/packages/mips_24kc/packages/auc_0.3.2-1_mips_24kc.ipk Installing rpcd-mod-rpcsys (2023-07-01-c07ab2f9-1) to root... Downloading https://downloads.openwrt.org/releases/23.05.5/packages/mips_24kc/base/rpcd-mod-rpcsys_2023-07-01-c07ab2f9-1_mips_24kc.ipk Installing attendedsysupgrade-common (8) to root... Downloading https://downloads.openwrt.org/releases/23.05.5/packages/mips_24kc/packages/attendedsysupgrade-common_8_all.ipk Configuring rpcd-mod-rpcsys. Configuring attendedsysupgrade-common. Configuring auc.

##### Errors

uci: Entry not found

now running

# auc -n -y

gives:

# auc -n -y
auc/0.3.2-1
Server:    https://sysupgrade.openwrt.org
Running:   23.05.5 r24106-10cc5fcd00 on ath79/generic (tplink,archer-c7-v2)
Available: 23.05.5 r24106-10cc5fcd00
Requesting package lists...
 luci-app-opkg: git-24.148.43905-2891ca4 -> git-25.116.54444-149d68e
 luci-mod-system: git-24.067.01860-7a82b2f -> git-25.116.54444-149d68e
 luci-theme-bootstrap: git-24.086.46634-1ffe078 -> git-25.116.54444-149d68e
 luci-mod-status: git-24.212.61237-b6da3f2 -> git-25.116.54444-149d68e
 luci-app-firewall: git-24.067.01746-69867db -> git-25.116.54444-149d68e
 luci-ssl: git-23.035.26083-7550ad6 -> git-25.116.54444-149d68e
 luci-proto-ppp: git-24.135.44542-f1ec9c2 -> git-25.116.54444-149d68e
 luci-mod-admin-full: git-19.253.48496-3f93650 -> git-25.116.54444-149d68e
 luci-base: git-24.264.56413-c7a3562 -> git-25.116.54444-149d68e
 luci-proto-ipv6: git-24.086.45108-51aee90 -> git-25.116.54444-149d68e
 luci: git-23.051.66410-a505bb1 -> git-25.116.54444-149d68e
 luci-light: git-23.024.33244-34dee82 -> git-25.116.54444-149d68e
 luci-mod-network: git-24.264.56960-63ba3cb -> git-25.116.54444-149d68e
 wireless-regdb: 2024.07.04-1 -> 2024.10.07-1
Requesting build....................
Image available at https://sysupgrade.openwrt.org/store/9f5c17669d210781732cf9d89156b0d7b9bd767cca42ed451e2d3908a5c65a1c/openwrt-23.05.5-1de5b916b676-ath79-generic-tplink_archer-c7-v2-squashfs-sysupgrade.bin
done

I have not used auc to do upgrades before. I've previously made a manual list of packages and added them back in manually after upgrades. This is partly because I don't like unnecessarily using someone-else's computing resources.

Anyway, it does not look to my naïve eye that I have anything extra associated with DNS running/installed, but I'm open to being educated. I'm not afraid of being shown to be ignorant of something obvious to everyone else - I regard it as a 'learning opportunity'.

I'm happy to post configs with personal/organisation identity information redacted (I help a volunteer/charity organisation): just say which would be useful.

Next step:

# auc -n -y -B 24.10
auc/0.3.2-1
Server:    https://sysupgrade.openwrt.org
Running:   23.05.5 r24106-10cc5fcd00 on ath79/generic (tplink,archer-c7-v2)
Invalid argument (22)

So I tried:

# auc -n -y -B 24.10.1
auc/0.3.2-1
Server:    https://sysupgrade.openwrt.org
Running:   23.05.5 r24106-10cc5fcd00 on ath79/generic (tplink,archer-c7-v2)
Invalid argument (22)

I can see something is Not Happy.

Further guidance happily accepted.

...

Update: having looked at the documentation ( https://openwrt.org/docs/guide-user/installation/attended.sysupgrade ) it looks like the command line switch should be -b, not -B, so:

# auc -n -y -b 24.10
auc/0.3.2-1
Server:    https://sysupgrade.openwrt.org
Running:   23.05.5 r24106-10cc5fcd00 on ath79/generic (tplink,archer-c7-v2)
Available: 24.10.1 r28597-0425664679
Requesting package lists...
 iwinfo: 2023-07-01-ca79f641-1 -> 2024.10.20~b94f066e-r1
 liblucihttp: 2023-03-15-9b5b683f-1 -> 2023.03.15~9b5b683f-r1
 cgi-io: 2022-08-10-901b0f04-21 -> 2022.08.10~901b0f04-r21
 kmod-crypto-gf128: 5.15.167-1 -> 6.6.86-r1
 opkg: 2022-02-24-d038e5b6-2 -> 2024.10.16~38eccbb1-r1
 wpad-basic-mbedtls: 2023-09-08-e5ccbfc6-8 -> 2024.09.15~5ace39b0-r2
 kmod-usb-core: 5.15.167-1 -> 6.6.86-r1
Package luci-app-opkg should be replaced by luci-app-package-manager.
 (Blue) luci-app-opkg: git-24.148.43905-2891ca4 -> luci-app-package-manager: 25.119.71430~be769af (/Blue)
 ubus: 2023-06-05-f787c97b-1 -> 2025.01.02~afa57cce-r1
 iw: 5.19-1 -> 6.9-r1
 kmod-crypto-manager: 5.15.167-1 -> 6.6.86-r1
 libuci: 2023-08-10-5781664d-1 -> 2025.01.20~16ff0bad-r1
 rpcd: 2023-07-01-c07ab2f9-1 -> 2024.09.17~9f4b86e7-r1
 busybox: 1.36.1-1 -> 1.36.1-r2
 kmod-crypto-ctr: 5.15.167-1 -> 6.6.86-r1
 libiwinfo: 2023-07-01-ca79f641-1 -> 2024.10.20~b94f066e-r1
 kmod-nft-fib: 5.15.167-1 -> 6.6.86-r1
 kmod-nfnetlink: 5.15.167-1 -> 6.6.86-r1
 kmod-crypto-hash: 5.15.167-1 -> 6.6.86-r1
 kmod-nf-reject6: 5.15.167-1 -> 6.6.86-r1
 kmod-crypto-aead: 5.15.167-1 -> 6.6.86-r1
 luci-mod-system: (Red)git-24.067.01860-7a82b2f -> 25.119.71430~be769af(/Red)
 kmod-nf-flow: 5.15.167-1 -> 6.6.86-r1
 libnl-tiny: 2023-07-27-bc92a280-1 -> 2025.03.19~c0df580a-r1
 kmod-lib-crc-ccitt: 5.15.167-1 -> 6.6.86-r1
 ucode-mod-uloop: 2024-07-11-1a8a0bcf-3 -> 2025.02.10~a8a11aea-r1
 px5g-mbedtls: 10 -> 11
 getrandom: 2022-08-13-4c7b720b-2 -> 2024.04.26~85f10530-r1
 ucode-mod-ubus: 2024-07-11-1a8a0bcf-3 -> 2025.02.10~a8a11aea-r1
 luci-theme-bootstrap: (Red)git-24.086.46634-1ffe078 -> 25.119.71430~be769af(/Red)
 kmod-pppoe: 5.15.167-1 -> 6.6.86-r1
 kmod-pppox: 5.15.167-1 -> 6.6.86-r1
 kmod-nf-reject: 5.15.167-1 -> 6.6.86-r1
 procd-ujail: 2023-06-25-2db83655-2 -> 2024.12.22~42d39376-r1
 base-files: 1562-r24106-10cc5fcd00 -> 1658~0425664679
 kmod-nf-nat: 5.15.167-1 -> 6.6.86-r1
 kmod-crypto-crc32c: 5.15.167-1 -> 6.6.86-r1
 ucode-mod-uci: 2024-07-11-1a8a0bcf-3 -> 2025.02.10~a8a11aea-r1
 libustream-mbedtls: 2023-02-25-498f6e26-1 -> 2024.07.28~99bd3d2b-r1
 netifd: 2024-01-04-c18cc79d-2 -> 2024.12.17~ea01ed41-r1
 firewall4: 2023-09-01-598d9fbb-1 -> 2024.12.18~18fc0ead-r1
 uboot-envtools: 2023.04-1 -> 2024.07-r1
 dnsmasq: 2.90-2 -> 2.90-r4
 procd: 2023-06-25-2db83655-2 -> 2024.12.22~42d39376-r1
 kmod-phy-ath79-usb: 5.15.167-1 -> 6.6.86-r1
 kmod-crypto-hmac: 5.15.167-1 -> 6.6.86-r1
 ubusd: 2023-06-05-f787c97b-1 -> 2025.01.02~afa57cce-r1
 kmod-crypto-acompress: 5.15.167-1 -> 6.6.86-r1
 rpcd-mod-ucode: 2023-07-01-c07ab2f9-1 -> 2024.09.17~9f4b86e7-r1
 ucode-mod-math: 2024-07-11-1a8a0bcf-3 -> 2025.02.10~a8a11aea-r1
 kmod-lib-crc32c: 5.15.167-1 -> 6.6.86-r1
 kmod-usb-ehci: 5.15.167-1 -> 6.6.86-r1
 luci-mod-status: (Red)git-24.212.61237-b6da3f2 -> 25.119.71430~be769af(/Red)
 kmod-crypto-sha512: 5.15.167-1 -> 6.6.86-r1
 libmbedtls: 2.28.9-1 -> 3.6.3-r1
 kmod-crypto-seqiv: 5.15.167-1 -> 6.6.86-r1
 kmod-nft-nat: 5.15.167-1 -> 6.6.86-r1
 kmod-usb2: 5.15.167-1 -> 6.6.86-r1
 luci-app-firewall: (Red)git-24.067.01746-69867db -> 25.119.71430~be769af(/Red)
 libubus: 2023-06-05-f787c97b-1 -> 2025.01.02~afa57cce-r1
 libmnl: 1.0.5-1 -> 1.0.5-r1
 jansson: 2.14-3 -> 2.14-r3
 odhcp6c: 2023-05-12-bcd28363-20 -> 2024.09.25~b6ae9ffa-r1
 fstools: 2023-02-28-bfe882d5-1 -> 2024.07.14~408c2cc4-r1
 uclient-fetch: 2023-04-13-007d9454-1 -> 2024.10.22~88ae8f20-r1
 kmod-crypto-ghash: 5.15.167-1 -> 6.6.86-r1
 kmod-ath9k: 5.15.167+6.1.110-1-1 -> 6.6.86.6.12.6-r1
 uci: 2023-08-10-5781664d-1 -> 2025.01.20~16ff0bad-r1
 ucode-mod-fs: 2024-07-11-1a8a0bcf-3 -> 2025.02.10~a8a11aea-r1
 luci-ssl: (Red)git-23.035.26083-7550ad6 -> 25.119.71430~be769af(/Red)
 dropbear: 2022.82-6 -> 2024.86-r1
 kmod-hwmon-core: 5.15.167-1 -> 6.6.86-r1
 libnftnl: 1.2.6-1 -> 1.2.8-r1
 rpcd-mod-file: 2023-07-01-c07ab2f9-1 -> 2024.09.17~9f4b86e7-r1
 odhcpd-ipv6only: 2023-10-24-d8118f6e-1 -> 2024.05.08~a2988231-r1
 procd-seccomp: 2023-06-25-2db83655-2 -> 2024.12.22~42d39376-r1
 ath10k-firmware-qca988x-ct: 2020-11-08-1 -> 2020.11.08-r1
 ucode-mod-nl80211: 2024-07-11-1a8a0bcf-3 -> 2025.02.10~a8a11aea-r1
 libjson-script: 2023-05-23-75a3b870-1 -> 2024.03.29~eb9bcb64-r1
 libiwinfo-data: 2023-07-01-ca79f641-1 -> 2024.10.20~b94f066e-r1
 ucode: 2024-07-11-1a8a0bcf-3 -> 2025.02.10~a8a11aea-r1
 rpcd-mod-luci: 20240305-1 -> 20240305-r1
 kmod-crypto-ccm: 5.15.167-1 -> 6.6.86-r1
 kmod-nf-log: 5.15.167-1 -> 6.6.86-r1
 luci-proto-ppp: (Red)git-24.135.44542-f1ec9c2 -> 25.119.71430~be769af(/Red)
 luci-mod-admin-full: (Red)git-19.253.48496-3f93650 -> 25.119.71430~be769af(/Red)
 ppp: 2.4.9.git-2021-01-04-4 -> 2.5.1-r1
 luci-base: (Red)git-24.264.56413-c7a3562 -> 25.119.71430~be769af(/Red)
 kmod-gpio-button-hotplug: 5.15.167-3 -> 6.6.86-r5
 logd: 2022-08-13-4c7b720b-2 -> 2024.04.26~85f10530-r1
 kmod-nf-log6: 5.15.167-1 -> 6.6.86-r1
 kmod-mac80211: 5.15.167+6.1.110-1-1 -> 6.6.86.6.12.6-r1
 luci-proto-ipv6: (Red)git-24.086.45108-51aee90 -> 25.119.71430~be769af(/Red)
 openwrt-keyring: 2022-03-25-62471e69-2 -> 2024.11.01~fbae29d7-r2
 jshn: 2023-05-23-75a3b870-1 -> 2024.03.29~eb9bcb64-r1
 nftables-json: 1.0.8-1 -> 1.1.1-r1
 attendedsysupgrade-common: 8 -> 9
 kmod-ppp: 5.15.167-1 -> 6.6.86-r1
 kmod-nft-offload: 5.15.167-1 -> 6.6.86-r1
 kmod-crypto-null: 5.15.167-1 -> 6.6.86-r1
 kmod-random-core: 5.15.167-1 -> 6.6.86-r1
 libjson-c: 0.16-3 -> 0.18-r1
Package auc should be replaced by owut.
 (Blue)auc: 0.3.2-1 -> owut: 2025.04.08~ef2bfb4d-r1(/Blue)
 uhttpd: 2023-06-25-34a8a74d-2 -> 2023.06.25~34a8a74d-r4
 kmod-nf-conntrack: 5.15.167-1 -> 6.6.86-r1
 ath10k-board-qca988x: 20230804-1 -> 20241110-r1
 usign: 2020-05-23-f1f65026-1 -> 2020.05.23~f1f65026-r1
 libblobmsg-json: 2023-05-23-75a3b870-1 -> 2024.03.29~eb9bcb64-r1
 kmod-crypto-gcm: 5.15.167-1 -> 6.6.86-r1
 kmod-ath10k-ct: 5.15.167+2022-05-13-f808496f-5 -> 6.6.86.2024.07.30~ac71b14d-r2
 rpcd-mod-rpcsys: 2023-07-01-c07ab2f9-1 -> 2024.09.17~9f4b86e7-r1
 ucode-mod-rtnl: 2024-07-11-1a8a0bcf-3 -> 2025.02.10~a8a11aea-r1
 ca-bundle: 20230311-1 -> 20241223-r1
 libuclient: 2023-04-13-007d9454-1 -> 2024.10.22~88ae8f20-r1
 kmod-crypto-cmac: 5.15.167-1 -> 6.6.86-r1
 kmod-crypto-rng: 5.15.167-1 -> 6.6.86-r1
 luci: (Red)git-23.051.66410-a505bb1 -> 25.119.71430~be769af(/Red)
 kmod-nf-conntrack6: 5.15.167-1 -> 6.6.86-r1
 luci-light: (Red)git-23.024.33244-34dee82 -> 25.119.71430~be769af(/Red)
 libgcc: 12.3.0-4 -> 13.3.0-r4
 kmod-usb-ledtrig-usbport: 5.15.167-1 -> 6.6.86-r1
 kmod-lib-lzo: 5.15.167-1 -> 6.6.86-r1
 kmod-ath: 5.15.167+6.1.110-1-1 -> 6.6.86.6.12.6-r1
 ubox: 2022-08-13-4c7b720b-2 -> 2024.04.26~85f10530-r1
 rpcd-mod-iwinfo: 2023-07-01-c07ab2f9-1 -> 2024.09.17~9f4b86e7-r1
 luci-mod-network: (Red)git-24.264.56960-63ba3cb -> 25.119.71430~be769af(/Red)
 kmod-nft-core: 5.15.167-1 -> 6.6.86-r1
 libucode: 2024-07-11-1a8a0bcf-3 -> 2025.02.10~a8a11aea-r1
 kmod-nls-base: 5.15.167-1 -> 6.6.86-r1
 uhttpd-mod-ubus: 2023-06-25-34a8a74d-2 -> 2023.06.25~34a8a74d-r4
 fwtool: 2019-11-12-8f7fe925-1 -> 2019.11.12~8f7fe925-r1
 jsonfilter: 2024-01-23-594cfa86-1 -> 2025.04.18~8a86fb78-r1
 liblucihttp-ucode: 2023-03-15-9b5b683f-1 -> 2023.03.15~9b5b683f-r1
 libubox: 2023-05-23-75a3b870-1 -> 2024.03.29~eb9bcb64-r1
 hostapd-common: 2023-09-08-e5ccbfc6-8 -> 2024.09.15~5ace39b0-r2
 kmod-ath9k-common: 5.15.167+6.1.110-1-1 -> 6.6.86.6.12.6-r1
 wireless-regdb: 2024.07.04-1 -> 2025.02.20-r1
 urngd: 2023-11-01-44365eb1-1 -> 2023.11.01~44365eb1-r1
 kmod-slhc: 5.15.167-1 -> 6.6.86-r1
 kmod-cfg80211: 5.15.167+6.1.110-1-1 -> 6.6.86.6.12.6-r1
 ppp-mod-pppoe: 2.4.9.git-2021-01-04-4 -> 2.5.1-r1
Requesting build......................
Image available at https://sysupgrade.openwrt.org/store/894501d2e2df6481ffe18b739c3093891fcd37de4ac1a03e87c63ac4aa0a713f/openwrt-24.10.1-bc8833b8b167-ath79-generic-tplink_archer-c7-v2-squashfs-sysupgrade.bin
done

I guess I can try the attended system upgrade and see if it gives better results. I'll need to find another time with users off the network, or see if I can find another router I can upgrade offline and do a hardware swap.

23.05 will get one or 2 minor revisipns, no rush yet

OK, so after some diagnosis, the problem is solved.

It was, as I rightly suspected, some config cruft. But in an unexpected place.

I upgraded the router from 23.05.5 to 24.10.1 using the auc upgrade process, and after the reboot, I had the same problem - no DNS resolving going on, either on the router or on clients.

#nslookup www.openwrt.org 127.0.0.1
nslookup: write to '127.0.0.1': Connection refused
;; connection timed out; no servers could be reached

Specifying a server worked:

# nslookup www.openwrt.org 1.1.1.1
Server:		1.1.1.1
Address:	1.1.1.1:53

Non-authoritative answer:
www.openwrt.org	canonical name = wiki-03.infra.openwrt.org
Name:	wiki-03.infra.openwrt.org
Address: 64.226.122.113

Non-authoritative answer:
www.openwrt.org	canonical name = wiki-03.infra.openwrt.org
Name:	wiki-03.infra.openwrt.org
Address: 2a03:b0c0:3:d0::1a51:c001

I spent some time looking at DNS-related solutions and looking into the auto-generated resolv.conf file:

# cat /tmp/resolv.conf.d/resolv.conf.auto 
# Interface wan
nameserver 1.1.1.1
nameserver 1.0.0.1
search <ISP's domain redacted>

I saw a suggestion to install the dnsmasq-full package to add some possibly missing necessary functionality, so I tried that. Did not work.

Then I did what I should have done in the first place and grepped the output of logread looking for problems. I had already looked at the output of dmesg and found nothing relevant.

# logread | grep dns
Wed May  7 11:40:25 2025 daemon.crit dnsmasq[1]: bad dhcp-range at line 31 of /var/etc/dnsmasq.conf.cfg01411c
Wed May  7 11:40:25 2025 daemon.crit dnsmasq[1]: FAILED to start up
Wed May  7 11:40:30 2025 daemon.crit dnsmasq[1]: bad dhcp-range at line 31 of /var/etc/dnsmasq.conf.cfg01411c
Wed May  7 11:40:30 2025 daemon.crit dnsmasq[1]: FAILED to start up
Wed May  7 11:40:35 2025 daemon.crit dnsmasq[1]: bad dhcp-range at line 31 of /var/etc/dnsmasq.conf.cfg01411c
Wed May  7 11:40:35 2025 daemon.crit dnsmasq[1]: FAILED to start up
Wed May  7 11:40:40 2025 daemon.crit dnsmasq[1]: bad dhcp-range at line 31 of /var/etc/dnsmasq.conf.cfg01411c
Wed May  7 11:40:40 2025 daemon.crit dnsmasq[1]: FAILED to start up
Wed May  7 11:40:45 2025 daemon.crit dnsmasq[1]: bad dhcp-range at line 31 of /var/etc/dnsmasq.conf.cfg01411c
Wed May  7 11:40:45 2025 daemon.crit dnsmasq[1]: FAILED to start up
Wed May  7 11:40:50 2025 daemon.crit dnsmasq[1]: bad dhcp-range at line 31 of /var/etc/dnsmasq.conf.cfg01411c
Wed May  7 11:40:50 2025 daemon.crit dnsmasq[1]: FAILED to start up
Wed May  7 11:40:50 2025 daemon.info procd: Instance dnsmasq::cfg01411c s in a crash loop 6 crashes, 0 seconds since last crash
Wed May  7 11:42:10 2025 daemon.crit dnsmasq[1]: bad dhcp-range at line 31 of /var/etc/dnsmasq.conf.cfg01411c
Wed May  7 11:42:10 2025 daemon.crit dnsmasq[1]: FAILED to start up
Wed May  7 11:42:10 2025 daemon.info procd: Instance dnsmasq::cfg01411c s in a crash loop 7 crashes, 0 seconds since last crash
Wed May  7 11:42:15 2025 daemon.crit dnsmasq[1]: bad dhcp-range at line 31 of /var/etc/dnsmasq.conf.cfg01411c
Wed May  7 11:42:15 2025 daemon.crit dnsmasq[1]: FAILED to start up
Wed May  7 11:42:15 2025 daemon.info procd: Instance dnsmasq::cfg01411c s in a crash loop 8 crashes, 0 seconds since last crash
Wed May  7 11:44:05 2025 daemon.crit dnsmasq[1]: bad dhcp-range at line 31 of /var/etc/dnsmasq.conf.cfg01411c
Wed May  7 11:44:05 2025 daemon.crit dnsmasq[1]: FAILED to start up
Wed May  7 11:44:05 2025 daemon.info procd: Instance dnsmasq::cfg01411c s in a crash loop 9 crashes, 1 seconds since last crash
Wed May  7 11:49:34 2025 daemon.crit dnsmasq[1]: bad dhcp-range at line 31 of /var/etc/dnsmasq.conf.cfg01411c
Wed May  7 11:49:34 2025 daemon.crit dnsmasq[1]: FAILED to start up
Wed May  7 11:49:39 2025 daemon.crit dnsmasq[1]: bad dhcp-range at line 31 of /var/etc/dnsmasq.conf.cfg01411c
Wed May  7 11:49:39 2025 daemon.crit dnsmasq[1]: FAILED to start up
Wed May  7 11:49:44 2025 daemon.crit dnsmasq[1]: bad dhcp-range at line 31 of /var/etc/dnsmasq.conf.cfg01411c
Wed May  7 11:49:44 2025 daemon.crit dnsmasq[1]: FAILED to start up
Wed May  7 11:49:49 2025 daemon.crit dnsmasq[1]: bad dhcp-range at line 31 of /var/etc/dnsmasq.conf.cfg01411c
Wed May  7 11:49:49 2025 daemon.crit dnsmasq[1]: FAILED to start up
Wed May  7 11:49:54 2025 daemon.crit dnsmasq[1]: bad dhcp-range at line 31 of /var/etc/dnsmasq.conf.cfg01411c
Wed May  7 11:49:54 2025 daemon.crit dnsmasq[1]: FAILED to start up
Wed May  7 11:49:59 2025 daemon.crit dnsmasq[1]: bad dhcp-range at line 31 of /var/etc/dnsmasq.conf.cfg01411c
Wed May  7 11:49:59 2025 daemon.crit dnsmasq[1]: FAILED to start up

Well, if dnsmasq has crashed, of course DNS name resolution is not going to be working. Doh!

So what is at line 31 of /var/etc/dnsmasq.conf.cfg01411c?

Busybox cat does not have the -n command switch, but head does, but I get the other 30 lines as well, which could be useful for context. In large files, that is inconvenient, but you can see the last few lines of the output of head by using tail.

# head -n 31 /var/etc/dnsmasq.conf.cfg01411c | tail -n 5


bogus-priv
conf-file=/usr/share/dnsmasq/rfc6761.conf
dhcp-range=set:lan,19,,255.255.255.0,12h

Another way of getting that range is to use sed, which gives the same output:

sed -n '26,31p' /var/etc/dnsmasq.conf.cfg01411c

Now, I'm not familiar with the syntax of the dnsmasq.conf file, but it is telling me that something is going wrong with dhcp, not DNS. This is causing dnsmasq to fail, and a consequence of that is that DNS resolving doesn't happen, but the root cause is a problem with dhcp configuration.

The error message in the system log says:

bad dhcp-range at line 31 of /var/etc/dnsmasq.conf.cfg01411c

So somehow, this config file is defining a range incorrectly.

Now, my set up has a device downstream from the OpenWrt router that is at a static IP address. I don't want that address used for DHCP, so my (quite possibly incorrect) solution to that was to set up a static DHCP lease (defined in Luci-Network-DHCP and DNS-Static Leases) for that address at 192.168.x.y, which should prevent it from being given out from the general DHCP pool of addresses. That general pool is defined (for each interface) at Luci-Network-Interfaces-lan-Edit-DHCP Server-General Setup. Here you can specify the Start address for the pool, and how many addresses are in the pool.

Start
Lowest leased address as offset from the network address.

Limit
Maximum number of leased addresses.

The config I had was accepted by 23.05.5, but rejected by 24.10.1. Start was '100' and Limit was '150', giving the config line:

dhcp-range=set:lan,19,,255.255.255.0,12h

I've changed Start to 33 and Limit to 100, giving the following config line:

dhcp-range=set:lan,192.168.7.33,192.168.7.132,255.255.255.0,12h

This allows dnsmasq not to crash at startup, so also allowing DNS name resolution to happen, but I'll admit to not understanding completely what is going on here. Some self-education is necessary.

As far as I am concerned, I believe it is legitimate to want to have one or several devices at static IPs in a subnet, with some, or all of the rest of the IP addresses assigned to a DHCP pool that need not be contiguous. It looks like I don't understand how to do that correctly in OpenWrt.

So, it's not always DNS.

Right, digging a bit deeper, it looks like this might be related:

Which in turn references a necrothread:

Which has an associated PR:

The text of which says:

If the uci `dhcp` configuration for the dhcp leases is incorrect then the call to `ipclac` (sic) fails.
However, the problem is that the dnsmasq configuration option 'dhcp-range' is still written
for this uci section even though the information generated by ipcalc is incorrect or not set.

I think I was hit by ipcalc writing a malformed dhcp-range, but it will take a bit of work to confirm.