Skip to content

Conversation

@tes5884
Copy link

@tes5884 tes5884 commented Jan 12, 2026

Summary

This PR enables sending client information (hostname, IP address, MAC address) to custom DoH/DoH3 upstream servers when send_client_info = true is configured. Currently, this feature only works for ControlD and NextDNS upstreams.

Changes

  • Modified addHeader() function in doh.go to add a default case that sends ControlD-style headers for custom upstreams when send_client_info = true
  • Updated comment in config.go to reflect that client info can be sent to any DNS server, not just ControlD

Behavior

When send_client_info = true is set for a custom upstream server:

  • The same headers used for ControlD upstreams are sent: x-cd-host, x-cd-ip, x-cd-mac, etc.
  • This allows custom DNS servers to receive client identification information
  • The feature only works for doh and doh3 upstream types (as documented)

Use Case

This enables users to configure custom DNS servers that can identify and log client information, similar to how ControlD and NextDNS servers receive this information.

Testing

  • Tested with a custom DoH upstream server
  • Verified headers are sent correctly when send_client_info = true
  • Verified no headers are sent when send_client_info = false (default)
  • Verified existing ControlD and NextDNS functionality still works

Fixes #280

I think this is the first PR I've ever submitted, so if I'm doing something wrong, please tell me...

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enable sending client info (hostname, IP, MAC) to custom DoH/DoH3 upstreams

1 participant