dnsmasq: add bare hostname for static leases

Static DHCP entries with dns enabled only had
their FQDN written to the generated hosts file, so
the bare hostname would not resolve unless the host also had
an active DHCP lease:

    $ dig +short dockbox-vm
    $ dig +short dockbox-vm.lan
    10.100.1.20

Signed-off-by: Tucker Kern <tuckkern@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/25012
Signed-off-by: Robert Marko <robimarko@gmail.com>
This commit is contained in:
Tucker Kern authored and Robert Marko committed 2026-09-08 18:35:20 +02:00
1 parent 7161fa5814
commit acde2ff93e
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -10,7 +10,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=dnsmasq
PKG_UPSTREAM_VERSION:=2.93
PKG_VERSION:=$(subst test,~~test,$(subst rc,~rc,$(PKG_UPSTREAM_VERSION)))
PKG_RELEASE:=2
PKG_RELEASE:=3
PKG_SOURCE:=$(PKG_NAME)-$(PKG_UPSTREAM_VERSION).tar.xz
PKG_SOURCE_URL:=https://thekelleys.org.uk/dnsmasq/
@@ -364,7 +364,7 @@ dhcp_host_add() {
config_get_bool dns "$cfg" dns 0
[ "$dns" = "1" ] && [ -n "$ip" ] && [ -n "$name" ] && {
echo "$ip $name${DOMAIN:+.$DOMAIN}" >> "$HOSTFILE_TMP"
echo "$ip $name${DOMAIN:+.$DOMAIN $name}" >> "$HOSTFILE_TMP"
}
config_get mac "$cfg" mac