This library contains C++ classes for DNS message transmission and reception and a simple Resolver class. While it requires libDwm, it is essentially a standalone DNS implementation for DNS client applications.
Most common resource record types are supported, and new resource record types are fairly easy to add. The library was motivated by the lack of a decent C++ DNS library with liberal licensing.
Most applications will just use members of the Dwm::Dns::Resolver class to perform DNS lookups, and members of the associated resource record data class to retrieve usable data from the returned Dwm::Dns::ResourceRecord objects. All resource record data classes derive from Dwm::Dns::RRData.
More advanced usage is possible via the Dwm::Dns::NameServer and Dwm::Dns::Message classes.
The library contains rudimentary support for EDNS, and the library supports DNSSEC record types. The list of currently supported resource record types:
libDwm is needed to compile the library.
We need an implementation of variant for resource record data. Depending on your installed C++ library and compiler, you may have it (it's part of the C++17 standard). The configure script will check if you have it, and fall back to using mpark::variant from Michael Park if the standard version is not found. This fallback is included in the mpark_variant header file I include with the library source. Note that the fallback appears to fill this requirement for older compilers such as g++ 6.3.0, clang on macOS Sierra, etc. In other words, you don't need full C++17 support.
Some of the library code dates back to the year 2000 when we didn't have widespread resolver support for various types of records newer than those in RFC 1035. I've since significantly refactored the code twice, in 2016 and 2017/2018. Some functionality was lost in the refactoring, which will likely return when I find time to work on it. And there are currently a few nits to fix, like the TCP fallback in the Dwm::Dns::Resolver class not set to always be used when the TC (truncated) bit is set in the UDP response from a name server. But as a first release, I think the library is definitely in a usable state for many C++ applications that have needs beyond what's possible with getaddrinfo() and getnameinfo(). Especially those applications that want a C++ API.