Changeset 42388


Ignore:
Timestamp:
2014-09-01T15:22:05+02:00 (3 years ago)
Author:
blogic
Message:

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: Tyler Fenby <tylerf@…>

Backport of r42318

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/barrier_breaker/package/network/services/dnsmasq/files/dnsmasq.init

    r42218 r42388  
    442442 
    443443        for name in $names; do 
    444                 [ "${name%.*}" == "$name" ] && \ 
    445                         name="$name${DOMAIN:+.$DOMAIN}" 
    446  
    447                 record="${record:+$record/}$name" 
     444                record="${record:+$record }$name" 
    448445        done 
    449446 
    450         xappend "--address=/$record/$ip" 
     447        echo "$ip $record" >> $HOSTFILE 
    451448} 
    452449 
     
    573570        [ $ADD_LOCAL_HOSTNAME -eq 1 ] && network_get_ipaddr lanaddr "lan" && { 
    574571                local hostname="$(uci_get system @system[0] hostname OpenWrt)" 
    575                 dhcp_hostrecord_add "" "${hostname%.$DOMAIN}${DOMAIN:+.$DOMAIN ${hostname%.$DOMAIN}}" "$lanaddr" 
     572                dhcp_domain_add "" "$hostname" "$lanaddr" 
    576573        } 
    577574 
Note: See TracChangeset for help on using the changeset viewer.