What Is FTLDNS™? In a sentence, FTLDNS™ is dnsmasq blended with Pi-hole’s special sauce. We bring the two pieces of software closer together while maintaining maximum compatibility with any updates Simon adds to dnsmasq . The Problems We have used dnsmasq as our DNS/DHCP server since Pi-hole began. However, as the project has grown and evolved, we reached a point where we started looking into providing our own powerful resolver for a few reasons: With FTL, we generate a variety of statistics by interpreting dnsmasq ‘s log file. While this works, doing it through a middleman (a log file) is obviously quite inefficient

‘s log file. While this works, doing it through a middleman (a log file) is obviously quite inefficient If a user chooses to disable logging, we’re unable to compute any statistics at all

There are some details of the DNS server we do not have access to (like cache usage) through the log file alone

Each OS distribution provides a different version of dnsmasq and this can prevent users for getting a flawless Pi-hole experience The Solution All these problems lead us to the idea of actually integrating a DNS resolver directly into FTL. The obvious choice for this is, of course, to base it on dnsmasq . We have a proof-of-concept implementation of FTL already developed and running. So we’re officially announcing FTLDNS™ and you can find it right here. One of the many ways to support us is purchasing from our Swag Store. Get your hands on this sweet mug to help spread the word. [product id=”11958″] The Non-technical Details FTLDNS has many benefits for you as user: No more dnsmasq version compatibility issues since we develop and provide the DNS resolver and FTL together

version compatibility issues since we develop and provide the DNS resolver and FTL together Upstream updates to dnsmasq can easily be integrated into our code since we don’t modify its code heavily

can easily be integrated into our code since we don’t modify its code heavily Processing will be much faster since we interact directly with the resolver instead of periodically parsing a log file

We can provide stats on cache usage and probably much more, which has been previously unavailable

Due to the direct integration into the resolver (using “FTL hooks”), we can compute statistics without any need for a log file. Instead of a “must have”, the log file will become an “opt-in” feature!

The Technical Details

We implement dnsmasq into our code using the modular nature of the C language. FTL v4.0 has always been multi-threaded for speed and efficiency. On startup, it launches a number of threads, each dedicated for specific tasks. We extend the already existing multi-threading in FTL to provide an even faster experience. After the historic information has been imported from the database, we start the DNS/DHCP resolver.

The daemon itself will behave exactly as dnsmasq with the addition of having threads orbiting it that provide the known FTL statistics on a dedicated Unix socket as well as on a Telnet-like interface. Furthermore, we add some minor speed improvements to enhance the user’s experience on low-performance devices when using huge blocking lists.

We keep our changes inside the code base of dnsmasq to the functional minimum to be able to easily upgrade to any future dnsmasq releases.

Note: this also means that we are not looking into making big changes to the resolver (like implementing regular expressions support). Although this seems advantageous at first sight, it will make upgrading dnsmasq later on almost impossible as these customizations would have to be reimplemented and carefully tested each time. Also, changing parts of the resolver’s source code could introduce new bugs to a code base that is extensively tested. We clearly want to avoid that! Stability and speed are the two drivers for the development of FTLDNS.

FTLDNS ( FTL v4.0 ), with its integrated resolver is beneficial in many ways