Skip to content
Contents
GuidesOpenWrt

Why a MAC-only DHCP tag disappears from the OpenWrt dnsmasq configuration

A tablet can receive a normal lease even when its special DHCP options never apply. Check the path from the saved host entry to the generated dnsmasq configuration before diagnosing the client.

A tablet can receive a normal lease even when its special DHCP options never apply. Check the path from the saved host entry to the generated dnsmasq configuration before diagnosing the client.

Find where the entry disappeared

This check applies to the OpenWrt dnsmasq startup script. Run it over SSH and replace study74 with the actual tag. With multiple instances, identify the configuration file serving the test subnet.

grep -n 'hostid\|hosttag' /etc/init.d/dnsmasq
grep -n 'study74' /var/etc/dnsmasq.conf.*
logread -e dnsmasq | tail -20

In the 24.10.5 and 25.12.6 scripts a host entry with empty ip, name and hostid returns before processing mac and tag. A rule accepted by dnsmasq directly can therefore be absent from its generated configuration.

Adding the unique host name produces a tagged entry in the generated file.

On isolated OpenWrt 25.12.6 x86/64, MAC and tag alone produced no matching line. Adding the unique name reader74 generated the MAC, set:study74 and reader74. We reverted the temporary entry. This test checked generation only.

Test without reserving a fixed address

Back up DHCP settings. Open the relevant host under Network → DHCP and DNS. If this interface permits an empty IPv4 address, retain the MAC and tag and add a unique host name. Over SSH the corresponding host field is name. Applying it can affect local name resolution. Stop if this change is unsuitable.

Apply the change and check the generated file again. If the entry is absent, check whether it is enabled, its instance and reload errors. Direct edits to a generated file will disappear on reload.

Check the option on the intended client

Confirm the generated entry has the set tag and that the desired DHCP option matches that tag. Assigning a tag differs from requiring an incoming request to carry one already.

Renew the test lease and check the MAC actually in use. For a DNS option compare the offered DNS addresses on the tagged and an untagged device. If both changed, inspect global options. Restore the saved name, tags and options and renew again.

In a separate test with two isolated OpenWrt 25.12.6 x86/64 guests, we read DHCP option 6 on the client. With only the MAC registered, renewal offered the default DNS address 192.168.1.1. With the name added, the same MAC received 192.0.2.53. An untagged MAC and a lease after rollback both received the default. The test address was used to inspect the lease, not to resolve names.

OpenWrt Parental Controls Not Working? Scheduled Internet Pauses, IPv6 and DNS

Explore hardware

Comments