[Dnsmasq-discuss] maximum number of "address" lines

Simon Kelley simon at thekelleys.org.uk
Thu Nov 27 16:58:38 GMT 2008

richardvoigt at gmail.com wrote:
> On Thu, Nov 27, 2008 at 3:14 PM, Simon Kelley <simon at thekelleys.org.uk> wrote:
>> Philippe Faure wrote:
>>> Hello,
>>> I run a script that takes URLs that display adds, and point them to an
>>> un-used Local IP address. for example:
>>> address="/123banners.com/"
>>> All of these addresses are in one file which DNSMASQ reads at startup.  I
>>> have noticed that the number of addresses in this file is now really large.
>>> About 17000 redirections.
>>> I have tried to start dnsmasq and it comes back with an error on line
>>> 13910. There was nothing different about line 13910, and 13909, except for
>>> the different url.
>>> I was wondering if DNSMASQ had an internal limit of the number of
>>> redirects, or the size of input files, or anything else that would cause a
>>> problem?
>> There's no internal limit. Note that performance will be much worse than
>> with lines in /etc/hosts, so if you don't need the implied wildcard in
>> address=/domain/ lines and you have lots and lots of them, /etc/hosts is a
>> better place to put them.
>>> Here is what I found in syslog:
>>> Nov 26 00:01:33 philserver dnsmasq[22070]: error at line 13910 of
>>> /etc/hosts_to_block
>>> Nov 26 00:01:33 philserver dnsmasq[22070]: FAILED to start up
>> The only syntax problem that's not blindingly obvious would be an illegal
>> character in the the domain: the legal ones are
>> A-Z a-z 0-9 - / _
> I hope that's the dot "." for a legal separator and not the slash "/".

dot "." is legal, as is slash. In the context of addess= lines, the / 
could only be used in quoted strings, since / is used as a delimiter


> Also, how does dnsmasq handle end-of-line?  Some editors might not
> show if the file changed between unix NL and dos CR+LF halfway
> through, but dnsmasq would then have to process the extra \r (^M)
> character.  Not likely if the file is autogenerated, but if the script
> or the underlying script engine was upgraded at some point it would be
> a possibility.

It was fixed, long ago, to cope with such things. That facilty may have 
rotted with time, I've certainly not tested it recently.


More information about the Dnsmasq-discuss mailing list