AdGuardHome icon indicating copy to clipboard operation
AdGuardHome copied to clipboard

When using Cloudflare as DOH, the CF-Connecting-IP is the true client IP.

Open anglesgirl opened this issue 2 years ago • 1 comments

Prerequisites

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

anglesgirl avatar Nov 03 '24 03:11 anglesgirl

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.

sofvaskina avatar Sep 04 '26 13:09 sofvaskina