#21926: dnsmasq multiple local domains support (patch)
-----------------------+------------------------
 Reporter:  wyldphyr3  |      Owner:  developers
     Type:  defect     |     Status:  new
 Priority:  normal     |  Milestone:
Component:  packages   |    Version:  Trunk
 Keywords:  dnsmasq    |
-----------------------+------------------------
 The configuration of dnsmasq through uci on OpenWRT (15.05, r46767) does
 not support multiple local domains. Although dnsmasqs manpage does
 explicitely state:

   '''-s, --domain=<domain>[,<address range>[,local]]'''
   Specifies DNS domains for the DHCP server. [...]

 Which is undeniably pluralized.

 The following patch corrects this shortcooming:
 {{{
 # diff dnsmasq /etc/init.d/dnsmasq
 80a81,84
 > append_domain() {
 >       xappend "--domain=$1"
 > }
 >
 146c150
 <       append_parm "$cfg" "domain" "--domain"
 ---
 >       config_list_foreach "$cfg" "domain" append_domain
 }}}

 '''Result:'''
 Configuration (/etc/config/dhcp) changed like this:
 {{{
 config dnsmasq
         [...]
         list domain
 'dmz.home.example.com,192.168.1.0/24,local'
         list domain
 'home.example.com,192.168.10.0/24,local'
         list domain
 'dev.home.example.com,192.168.12.0/24,local'
         [...]

 }}}
 Result (/var/etc/dnsmasq.conf):
 {{{
 domain=dmz.home.example.com,192.168.1.0/24,local
 domain=home.home.example.com,192.168.10.0/24,local
 domain=dev.home.example.com,192.168.12.0/24,local
 }}}

 This does correctly resolve all hosts to the correct subdomains by
 specifing them inside the network, i.e.:
 {{{
 config host
         option ip '192.168.1.1'
         option mac 'aa:bb:cc:dd:ee:f0'
         option name 'gw'
 }}}
 Resolves ''gw.dmz.home.example.com'' to ''192.168.1.1'' and vice versa.
 {{{
 config host
         option ip '192.168.10.10'
         option mac 'aa:bb:cc:dd:ee:f1'
         option name 'ozzy'
 }}}
 Resolves''ozzy.home.example.com'' to ''129.168.10.10'' and vice versa.
 {{{
 config host
         option ip '192.168.12.10'
         option mac 'aa:bb:cc:dd:ee:f2'
         option name 'lemmy'
 }}}
 Resolves ''lemmy.dev.home.example.com'' to ''192.168.12.10'' and vice
 versa.

--
Ticket URL: <https://dev.openwrt.org/ticket/21926>
OpenWrt <http://openwrt.org>
Opensource Wireless Router Technology
_______________________________________________
openwrt-tickets mailing list
[email protected]
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-tickets

Reply via email to