dnsmasq: expand 'add_local_hostname' fexibility including FQDN
authorEric Luehrsen <ericluehrsen@hotmail.com>
Sat, 14 Jan 2017 02:37:25 +0000 (21:37 -0500)
committerJo-Philipp Wich <jo@mein.io>
Wed, 1 Feb 2017 23:13:49 +0000 (00:13 +0100)
commit1b4e3eda1b4b9c60d979744faed4935538d8f75f
tree37886780f69ad2a12305c63b0e460079456a598e
parentbf2f09c00593a131287d1cb152485f9a08319058
dnsmasq: expand 'add_local_hostname' fexibility including FQDN

ref commit 612e2276b4a2f57fcbbe79b95bec4a46e89d748c
ref commit ec63e3bf1312ab4c666f7417ca9844857214047f

'option add_local_hostname' scripted implementation statically assigns
this host in auto generated host file at init. If IFUP or other signals
do not occur, then address changes are not tracked. The script doesn't
apply all the addresses at an interface. This may make logs obscure.
The script only puts the bare host name (maybe not FQDN) in host file,
but if '--exapandhosts' is enabled, then /etc/hosts entries will be
suffixed, and "127.0.0.1 localhost" becomes "localhost.lan".

dnsmasq provides an option to perform this function, but it is rather
greedy. '--interface-name=<name>,<iface>' will assign the name to all
IP on the specified interface (except link local). This is a useful
feature, but some setups depend on the original restrictive behavior.

'option add_local_fqdn' is added to enhance the feature set, but
if not entered or empty string, then it will default to original
option and behavior. This new option has a few settings. At each
increased setting the most detailed name becomes the PTR record:
0 - same as add_local_hostname 0 or disabled
1 - same as add_local_hostname 1
2 - assigns the bare host name to all IP w/ --dnsmasq-interface
3 - assigns the FQDN and host to all IP w/ --dnsmasq-interface
4 - assigns <iface>.<host>.<domain> and above w/ --dnsmasq-nterface

'option add_wan_fqdn' is added to run the same procedure on
inferred WAN intefaces. If an interface has 'config dhcp' and
'option ignore 1' set, then it is considered WAN. The original
option would only run on DHCP serving interfaces.

Signed-off-by: Eric Luehrsen <ericluehrsen@hotmail.com>
package/network/services/dnsmasq/Makefile
package/network/services/dnsmasq/files/dnsmasq.init