From acde2ff93ec1c2d234011ae246e3a0f1038cd2ec Mon Sep 17 00:00:00 2001 From: Tucker Kern Date: Thu, 3 Sep 2026 09:11:58 -0600 Subject: [PATCH] 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 Link: https://github.com/openwrt/openwrt/pull/25012 Signed-off-by: Robert Marko --- package/network/services/dnsmasq/Makefile | 2 +- package/network/services/dnsmasq/files/dnsmasq.init | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package/network/services/dnsmasq/Makefile b/package/network/services/dnsmasq/Makefile index ac737f51059..17efb54cf5c 100644 --- a/package/network/services/dnsmasq/Makefile +++ b/package/network/services/dnsmasq/Makefile @@ -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/ diff --git a/package/network/services/dnsmasq/files/dnsmasq.init b/package/network/services/dnsmasq/files/dnsmasq.init index dd8353a3862..791418a311f 100755 --- a/package/network/services/dnsmasq/files/dnsmasq.init +++ b/package/network/services/dnsmasq/files/dnsmasq.init @@ -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