{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreidois5w6npdep6tpwdmfg5zurw5f463fwouhtcv2z4unn3jsjm3wy",
"uri": "at://did:plc:pi6woz4d47bkuws673w2il2r/app.bsky.feed.post/3mnrandxpyog2"
},
"path": "/t/ann-dnsbase-1-0-a-flexible-successor-to-the-dns-library/14230#post_1",
"publishedAt": "2026-06-08T07:10:49.000Z",
"site": "https://discourse.haskell.org",
"tags": [
"dnsbase 1.0.2.0",
"dns",
"Net.DNSBase.Extensible",
"demos/",
"idna2008",
"github.com/dnsbase/dnsbase"
],
"textContent": "If you write DNS-related code in Haskell — or have been thinking about it — there’s a new library on Hackage that may be worth a look: dnsbase 1.0.2.0.\n\ndnsbase is a DNS stub-resolver library. Its IO layer is derived from Kazu Yamamoto’s dns package, and the basic lookup interface — `lookupA`, `lookupMX`, `lookupTXT`, … — is deliberately similar, so migration is straightforward for anyone already familiar with `dns`. What dnsbase layers on top sits in the resource-record data model and the configuration story.\n\nEvery RR type’s payload is modeled with its own Haskell type. SVCB and HTTPS service-binding records (RFC 9460) are first-class, with up-to-date SvcParam coverage. EDNS option support includes Extended DNS Errors with a user-extensible info-code name registry. Coverage of both widely-deployed and historical RR types is comprehensive — only the most marginal obsolete or experimental types remain unimplemented.\n\nApplications can extend the library at runtime with new RR types, EDNS options, or SVCB/HTTPS SvcParam values without forking the library code. Extensions are registered by constructing a pure resolver configuration value, not via side-effects on mutable global state, and application-supplied types take precedence over the library’s built-in implementation at the same codepoint. The Net.DNSBase.Extensible module has worked examples, and three runnable demos in the demos/ directory cover adding a custom RR type, an EDNS option, and an SVCB parameter value.\n\nThe library does not throw exceptions; lookups return `IO (Either DNSError a)` for various values of `a`. Exceptions are just an `either throwIO pure` away, if you prefer to throw and catch exceptions.\n\nThe library has been deployed for 6+ years as part of a DANE/DNSSEC survey (used `dns` for ~4 years before that) — this makes ~108 million queries per day in ~3.5-hours, along with SMTP STARTTLS probes and database updates. Porting that production engine to 1.0 was the final validation step before this release.\n\ndnsbase requires GHC 9.10 or 9.12. The API makes essential use of `RequiredTypeArguments` and a handful of other recent extensions, so the lower bound isn’t easily relaxed; if you’re on an older compiler, please bookmark this for when you next upgrade.\n\nThe library meshes well with the companion idna2008 package, also just released, making it possible to correctly parse IDN domain names.\n\nFeedback, bug reports, and contributions are welcome at github.com/dnsbase/dnsbase. If you’ve ever wished for stronger types on the RData side, or wanted to handle an SVCB parameter your DNS library didn’t yet support, dnsbase is built for exactly that.\n\n— Viktor",
"title": "[ANN] dnsbase 1.0: a flexible successor to the \"dns\" library"
}