aboutsummaryrefslogtreecommitdiffstats
path: root/package/dnsmasq/files/dnsmasq.init
diff options
context:
space:
mode:
Diffstat (limited to 'package/dnsmasq/files/dnsmasq.init')
-rw-r--r--package/dnsmasq/files/dnsmasq.init14
1 files changed, 11 insertions, 3 deletions
diff --git a/package/dnsmasq/files/dnsmasq.init b/package/dnsmasq/files/dnsmasq.init
index 47c4c2d2e6..15f856d4e5 100644
--- a/package/dnsmasq/files/dnsmasq.init
+++ b/package/dnsmasq/files/dnsmasq.init
@@ -296,9 +296,17 @@ dhcp_domain_add() {
local raddr="${4:+$4.$3.$2.$1.in-addr.arpa}"
for name in $names; do
- append args "-A /$name/$ip"
- [ -n "$raddr" ] && \
- append args "--ptr-record=$raddr,$name"
+ local fqdn="$name"
+
+ [ "${fqdn%.*}" == "$fqdn" ] && \
+ fqdn="$fqdn${DOMAIN:+.$DOMAIN}"
+
+ append args "-A /$fqdn/$ip"
+
+ [ -n "$raddr" ] && {
+ append args "--ptr-record=$raddr,$fqdn"
+ raddr=""
+ }
done
}