AdguardTeam / AdGuardHome

Network-wide ads & trackers blocking DNS server
https://adguard.com/adguard-home.html
GNU General Public License v3.0
24.97k stars 1.8k forks source link

send client ip to upstread dns adguard #7316

Open miladtempaccount opened 1 week ago

miladtempaccount commented 1 week ago

Prerequisites

The problem

I use an upstream DNS for my clients based on their CIDR ( it's a geo load balancing DNS server ), now I want to be able to cache the client ip and server that has been told to client for 24 hour and as I only see adguard home IP address its impossible to do such, how can I do it ?

actually I want to achieve sticky sessions or something like that via this trick

flow :

Client => adguard home => upstream DNS

Is there any solution for me ?

Proposed solution

if there would be an option to send client ip to upstream dns it would be great or I don't know something like that

Alternatives considered and additional information

replace the adguard with my upstream DNS and develop what ever I need from adguard on that DNS system

ZeroClover commented 5 days ago

The feature has been implemented, and it is called "EDNS Client Subnet", aka ECS.

If your DNS server can properly handle the EDNS extension, then it can retrieve the original client IP from the ECS.

image

Unfortunately, due to privacy concerns, ECS generally does not pass the exact client IP to the upstream DNS, but rather passes the precision of IPv4 /24 & IPv6 /56.

miladtempaccount commented 4 days ago

well I need to see client ip (/32) on upstream side, what can I do ?