From 4947d8ccfbaae8e31ff3301b2961f7b21749f9fa Mon Sep 17 00:00:00 2001 From: Tzvi Spitz Date: Mon, 12 Jan 2026 15:17:11 -0500 Subject: [PATCH] feat: enable client info for custom DoH/DoH3 upstreams Allow sending client information (hostname, IP, MAC) to custom upstream servers when send_client_info = true is configured, not just ControlD and NextDNS servers. When send_client_info = true is set for a custom upstream, ctrld will send ControlD-style headers (x-cd-host, x-cd-ip, x-cd-mac, etc.) to the upstream server, enabling custom DNS servers to receive client identification information. --- config.go | 2 +- doh.go | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/config.go b/config.go index 73484d70..53bfd050 100644 --- a/config.go +++ b/config.go @@ -385,7 +385,7 @@ func (uc *UpstreamConfig) VerifyDomain() string { } // UpstreamSendClientInfo reports whether the upstream is -// configured to send client info to Control D DNS server. +// configured to send client info to the DNS server. // // Client info includes: // - MAC diff --git a/doh.go b/doh.go index 3459cb8a..314ef15a 100644 --- a/doh.go +++ b/doh.go @@ -159,6 +159,9 @@ func addHeader(ctx context.Context, req *http.Request, uc *UpstreamConfig) { dohHeader = newControlDHeaders(ci) case uc.isNextDNS(): dohHeader = newNextDNSHeaders(ci) + default: + // For custom upstreams with send_client_info enabled, use ControlD-style headers + dohHeader = newControlDHeaders(ci) } } }