AdGuardHome icon indicating copy to clipboard operation
AdGuardHome copied to clipboard

send client ip to upstread dns adguard

Open miladtempaccount opened this issue 1 year ago • 3 comments

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 request a feature or enhancement and not ask a question

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

miladtempaccount avatar Oct 03 '24 13:10 miladtempaccount

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.

ZeroClover avatar Oct 05 '24 16:10 ZeroClover

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

miladtempaccount avatar Oct 06 '24 19:10 miladtempaccount

The feature has been implemented

Unfortunately ECS is not the feature OP is asking for here. I came here because I have the same issue too, I would like AGH to pass the client IP on to the upstream DNS server, which it isn't doing.

ECS is not meant for that purpose; it's meant for things like CDNs to be able to resolve to locations nearer to the client (hence passing the subnet only, as it's good enough to determine approximate location).

The OP's and my request is actually to pass on the complete IP of the client to the upstream DNS server.

dinosmm avatar Jun 06 '25 00:06 dinosmm