I try to let dnsmasq take over all dhcp requests, but if I set domain-name in dhcp subnet, dnsmasq says syntax error.
Tried on both erl and erx, 1.9.0.
Here is my dhcp config:
show service dhcp-server shared-network-name dhcp-lan authoritative disable subnet 192.168.32.0/20 { default-router 192.168.32.1 dns-server 192.168.32.1 domain-name int.xxxx.com lease 86400 start 192.168.40.0 { stop 192.168.46.255 } static-mapping dev { ip-address xxxxxx mac-address 1xxxxxx } static-mapping sskaje { ip-address xxxxxx mac-address xxxxxx } }
generated dnsmasq-dhcp-config.conf
###shared-network dhcp-lan #subnet 192.168.32.0/20 dhcp-range=set:dhcplan,192.168.40.0,192.168.46.255,255.255.240.0,86400 domain=int.xxxxxx.com,192.168.32.0/20,local dhcp-option=tag:dhcplan,option:domain-name,int.xxxxxx.com dhcp-option=tag:dhcplan,option:router,192.168.32.1 dhcp-option=tag:dhcplan,option:dns-server,192.168.32.1 #static reservations for subnet 192.168.32.0/20 dhcp-host=xxxxxx #dev host-record=dev.int.xx.com,192.168.36.20,86400 #dev.int.youbaowuxian.com dhcp-host=xxxxxx #sskaje host-record=sskaje.int.xxxx.com,192.168.36.50,86400 #sskaje.int.youbaowuxian.com #end of subnet 192.168.32.0/20 ###end of shared-network dhcp-lan
The error line is
domain=int.xxxxxx.com,192.168.32.0/20,local
If I remove the ',local', and restart dnsmasq, it worked.
According to dnsmasq man page,
If the address range is given as ip-address/network-size, then a additional flag
"local" may be supplied which has the effect of adding --local declarations for
forward and reverse DNS queries. Eg. --domain=thekelleys.org.uk,192.168.0.0/24,
local is identical to --domain=thekelleys.org.uk,192.168.0.0/24
--local=/thekelleys.org.uk/ --local=/0.168.192.in-addr.arpa/ The network size
must be 8, 16 or 24 for this to be legal.
The CIDR I'm using is /20, not accepted by dnsmasq.
Can you add some extra 'if' before adding that ',local' ?