AdguardTeam / AdGuardHome

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

Read Client info from NextDNS CLI #5675

Open coltonshipley opened 1 year ago

coltonshipley commented 1 year ago

Prerequisites

Description

What problem are you trying to solve?

When using AGH as the upstream DoH in the NextDNS CLI The client name isn't parsed. Client info is passed from NextDNS CLI in the header. See here - https://github.com/nextdns/nextdns/blob/master/resolver/doh.go#L97

Proposed solution

Allow options in AGH to pull this client info from these header fields.

Alternatives considered

There seems to be no other good way to do this and NextDNS CLI is supported on many devices. (I'm using on my UDM Pro as the DoH proxy and setting AGH up to receive/answer all requests)

Additional information

felipejfc commented 5 months ago

I tried to give this one a go but NextDNS is not sending the headers in my tests. My setup is I have it installed with -setup-router, -report-client-info and forwarding to adguard on my UDM PRO and only headers I see arriving are

    req.Header.Set("Content-Type", "application/dns-message")
    req.Header.Set("X-Conf-Last-Modified", "true")