Repository navigation
Security Audit - Third-party DNS: detect ControlD by asking for A, not CNAME - #1330
Merged
tvancott42 merged 1 commit intoOct 31, 2026
Merged
Conversation
…t CNAME verify.controld.com has no public record; ControlD's resolvers synthesize the CNAME to api.controld.com, but only for an A query. A CNAME-type query comes back NODATA even through ControlD, so the probe never saw the chain and ctrld on the gateway was never detected (no DoH credit). Query A and read the CNAME out of the returned chain. Refs Ozark-Connect#948 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
Collaborator
|
@truffshuff very nice! Yeah I don't run ControlD on any of my sites, so this one had me a little stumped. I'm glad you figured this out. I'll get this worked into 2.11.0-preview and the next patch release. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
The ControlD probe from #817 queries
verify.controld.comwithQueryType.CNAME, which never matches. The name has no public record (Cloudflare DoH returns NODATA), and ControlD's resolvers synthesize theCNAME api.controld.comonly for an A query. A CNAME-type query comes back NODATA even through ctrld. That's why the debug logs in #948 showno ControlD record via 10.140.1.1 (CNAMEs: [none], A: [none])for every gateway, whiledig verify.controld.com(type A) on the same gateway returns the chain.This changes the query to
QueryType.A. The existing check already reads the CNAME (and the147.185.34.xA record) out of the answer chain, so nothing else changes. With detection working, the existing gateway path from #817 setsHasThirdPartyDnsand the DoH finding gets ControlD's neutral treatment.Closes #948
Checklist
A first PR that doesn't reference an issue is closed automatically; see CONTRIBUTING.md.
dev(fix for a released version) or the activerelease/X.Ybranch (feature), notmaindotnet buildhas zero warnings, and tests for the change passTesting
ProbeGatewayDnsAsync_RealControlDProbe_DetectsOnlyWhenResolverChainsToControlD. It runs the real probe (no override) throughWithDialeragainst a loopback DNS-over-TCP resolver that behaves like ControlD: the A query returns the CNAME + A chain, and everything else, including a CNAME-type query, returns NODATA. It covers both a ControlD resolver (detected) and a plain one (not detected). Both cases fail with the oldQueryType.CNAMEand pass with the fix.NetworkOptimizer.Audit.Testssuite passes (4001), built with the .NET 10 SDK with 0 warnings.verify.controld.comis NODATA over Cloudflare DoH, and resolves toapi.controld.com/147.185.34.1(type A) through ctrld on a UniFi Cloud Gateway Fiber. I haven't yet run the patched build against that gateway end to end.🤖 Generated with Claude Code