When using Cloudflare as DOH, the CF-Connecting-IP is the true client IP.
Prerequisites
-
[X] I have checked the Wiki and Discussions and found no answer
-
[X] I have searched other issues and found no duplicates
-
[X] I want to report a bug and not ask a question or ask for help
-
[X] I have set up AdGuard Home correctly and configured clients to use it. (Use the Discussions for help with installing and configuring clients.)
Platform (OS and CPU architecture)
Linux, ARM64
Installation
GitHub releases or script from README
Setup
On a router, DHCP is handled by the router
AdGuard Home version
v0.107.53
Action
Replace the following command with the one you're calling or a description of the failing action:
nslookup -debug -type=a 'www.example.com' '$YOUR_AGH_ADDRESS'
Expected result
When using Cloudflare as DOH, the CF-Connecting-IP is the true client IP. When using Cloudflare's DOH service with CDN acceleration, CF-Connecting-IP is the actual IP address of the user. This is because DOH encrypts DNS requests, and CF-Connecting-IP can correctly display the user's IP even if the request has been accelerated by CDN.
Actual result
When using Cloudflare's DOH service with CDN acceleration, CF-Connecting-IP is the actual IP address of the user. This is because DOH encrypts DNS requests, and CF-Connecting-IP can correctly display the user's IP even if the request has been accelerated by CDN.
Additional information and/or screenshots
miui
This is a configuration step. AdGuardHome honors the CF-Connecting-IP header when using DoH, but only if the proxy IP address is specified in dns.trusted_proxies in AdGuardHome.yaml. Add the Cloudflare IP ranges, and everything should work correctly.