[Dnsmasq-discuss] [feature proposal] Alpha sort of files under conf-dir

Simon Kelley simon at thekelleys.org.uk
Fri Jan 10 20:47:16 GMT 2020

Seems like a good thing to do. I took the opportunity to re-implement in
the same code style at the existing code, but the functionality (should
be) the same.




On 08/01/2020 00:11, Evgenii Seliavka wrote:
> Hi there,
> I am extensively using dnsmasq in conjunction with *--conf-dir
> *configuration property. My test env is *CentOS Linux release 7.4.1708
> (Core) *with *3.10.0-693.17.1.el7.x86_64* kernel.
> In our set up we strongly relying on the order dnsmasq will read and
> apply DNS records under the configuration directory. Basically, we have
> files like: 0001_this_should_be_first, 0002_comes_second, etc. and we
> expecting them to be read in alpha order. We need this strict ordering
> guarantee because of PTR records, according to the documentation only
> first A record will receive corresponding PTR record:
> /--host-record=<name>[,<name>....],[<IPv4-address>],[<IPv6-address>][,<TTL>]
> Add A, AAAA and PTR records to the DNS. This adds one or more names to
> the DNS with associated IPv4 (A) and IPv6 (AAAA) records. A name may
> appear in more than one --host-record and therefore be assigned more
> than one address. Only the first address creates a PTR record linking
> the address to the name. This is the same rule as is used reading
> hosts-files. --host-record options are considered to be read before
> host-files, so a name appearing there inhibits PTR-record creation if it
> appears in hosts-file also. Unlike hosts-files, names are not expanded,
> even when --expand-hosts is in effect. Short and long names may appear
> in the same --host-record, eg.
> --host-record=laptop,laptop.thekelleys.org
> <http://laptop.thekelleys.org>,,1234::100 If the time-to-live
> is given, it overrides the default, which is zero or the value of
> --local-ttl. The value is a positive integer and gives the time-to-live
> in seconds./
> /
> /
> The problem is that *readdir* syscall can't guarantee any
> order http://man7.org/linux/man-pages/man3/readdir.3.html at least on Linux.
> I prepared this small patch(see the attachment) and want to know
> community opinion on how useful it is?
> -- 
> Best Regards,
> Seliavka Evgenii
> _______________________________________________
> 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