[Dnsmasq-discuss] dnsmasq fails to parse long server directive

Simon Kelley simon at thekelleys.org.uk
Sat Dec 28 17:02:39 GMT 2013


On 27/12/13 18:43, Maciej Soltysiak wrote:
> Hello!
>
> I have a bug report on dnsmasq 2.68test1 [options: IPv6 GNU-getopt
> no-DBus no-i18n no-IDN DHCP DHCPv6 no-Lua TFTP no-conntrack no-ipset
> auth]
>
> I'm using server=/domain1.com/domain2.com/home.lan/ directive to force
> NXDOMAIN on the domains I don't want to be resolved.
>
> I noticed it works until length of the config line is exceeded. If it
> is, it fails to read the next line and says: bad address at line 13 of
> /var/etc/dnsmasq.conf
>
> Example of what works:
> 12: server=/admob.com/adwhirl.com/localytics.com/mopub.com/mydas.mobi/bkrtx.com/204st.us/lognormal.net/newrelic.com/scorecardresearch.com/cookie.avt.pl/cookie.gazeta.pl/stats4you.com/mklik.gazeta.pl/analytics.gazeta.pl/ad.gazeta.pl/wr.zl.interia.pl/krxd.net/mk-zl.interia.pl/hit.interia.pl/adfunky.com/adfunkyserver.com/rek.www.wp.pl/dto.wp.pl/csi.gstatic.com/api.echoenabled.com/salecycle.com/edipresse.pl/googletagmanager.com/adct.gg.pl/ngacm.com/ngastatic.com/googleadservices.com/bbelements.com/adreport.pl/smartadserver.com/www-google-analytics.l.google.com/google-analytics.com/samsungrm.net/internetat.tv/samsungadhub.com/hub.com.pl/hub2.com.pl/usatoday.com/doubleclick.net/akadns.net/edgekey.net/gemius.pl/adocean.pl/4chan-ads.org/offers.bittorrent.com/lfstmedia.com/openx.net/pagead2.googlesyndication.com/hit.stat24.com/hit.stat.pl/quantserve.com/ad.adview.pl/adv.wp.pl/vda.wp.pl/dot.wp.pl/tod.wp.pl/csr.onet.pl/adkontekst.pl/tradedoubler.com/reklama.onet.pl/kropka.onet.pl/d111
0e4.se/richmetrics.com/home.lan/
> 13: server=127.0.0.1#2053
>
> Example of what doesn't work:
> 12: server=/admob.com/adwhirl.com/analytics.localytics.com/mopub.com/mydas.mobi/bkrtx.com/204st.us/lognormal.net/newrelic.com/scorecardresearch.com/cookie.avt.pl/cookie.gazeta.pl/stats4you.com/mklik.gazeta.pl/analytics.gazeta.pl/ad.gazeta.pl/wr.zl.interia.pl/krxd.net/mk-zl.interia.pl/hit.interia.pl/adfunky.com/adfunkyserver.com/rek.www.wp.pl/dto.wp.pl/csi.gstatic.com/api.echoenabled.com/salecycle.com/edipresse.pl/googletagmanager.com/adct.gg.pl/ngacm.com/ngastatic.com/googleadservices.com/bbelements.com/adreport.pl/smartadserver.com/www-google-analytics.l.google.com/google-analytics.com/samsungrm.net/internetat.tv/samsungadhub.com/hub.com.pl/hub2.com.pl/usatoday.com/doubleclick.net/akadns.net/edgekey.net/gemius.pl/adocean.pl/4chan-ads.org/offers.bittorrent.com/lfstmedia.com/openx.net/pagead2.googlesyndication.com/hit.stat24.com/hit.stat.pl/quantserve.com/ad.adview.pl/adv.wp.pl/vda.wp.pl/dot.wp.pl/tod.wp.pl/csr.onet.pl/adkontekst.pl/tradedoubler.com/reklama.onet.pl/kropka.on
et.pl/d1110e4.se/richmetrics.com/home.lan/
> 13: server=127.0.0.1#2053
>
> The difference is on line 12: "analytics.localytics.com" vs just
> "localytics.com".
> If i use the longer version, the next line cannot be read.
>
> Am I hitting some static limit of an array?
Yes.

> Can I work around it?

Split the server line up

server=/domain.one/domain.two/


is exactly equivalent to

server=/domain.one/
server=/domain.two/



Cheers,

Simon.


>
> Best regards,
> Maciej
>
> _______________________________________________
> Dnsmasq-discuss mailing list
> Dnsmasq-discuss at lists.thekelleys.org.uk
> http://lists.thekelleys.org.uk/mailman/listinfo/dnsmasq-discuss
>




More information about the Dnsmasq-discuss mailing list