Commit abd77939 authored by blogic's avatar blogic

dnsmasq: Create rDNS records for LuCI "Hostnames"

LuCI creates "domain" UCI config sections, which the dnsmasq init file
then, currently, translates into "address" config lines. This is not
the correct usage of "address" (see r36943), and also causes rDNS
records to not be created. This patches dnsmasq.init to utilize the
additional hosts file introduced in r40799 for such domain names,
resolving both issues.
Signed-off-by: default avatarTyler Fenby <>

Backport of r42318

git-svn-id: svn:// 3c298f89-4303-0410-b956-a3cf2f4a3e73
parent b402d2d1
......@@ -441,13 +441,10 @@ dhcp_domain_add() {
[ -n "$ip" ] || return 0
for name in $names; do
[ "${name%.*}" == "$name" ] && \
record="${record:+$record }$name"
xappend "--address=/$record/$ip"
echo "$ip $record" >> $HOSTFILE
dhcp_srv_add() {
......@@ -572,7 +569,7 @@ start_service() {
local lanaddr
[ $ADD_LOCAL_HOSTNAME -eq 1 ] && network_get_ipaddr lanaddr "lan" && {
local hostname="$(uci_get system @system[0] hostname OpenWrt)"
dhcp_hostrecord_add "" "${hostname%.$DOMAIN}${DOMAIN:+.$DOMAIN ${hostname%.$DOMAIN}}" "$lanaddr"
dhcp_domain_add "" "$hostname" "$lanaddr"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment