Add "DNS X-Proxied-For" Support -> quick win: DoH, DOT, DNSCrypt, Loadbalancing, dns rulesets with dnsdist

I have been running my own DNS infrastructure for some time now, including my own recursive DNS servers.
Currently the setup consists of dnsdist (DNS proxy) and unbound.
I have learned to appreciate dnsdist, because it allows to create DoH, DoT, DNSCrypt, load balancing and DNS rulesets very easily.

However, if you use dnsdist in front of pi-hole, only the dnsdist ip address will appear in the pi-hole logs. Since this problem is known (e.g. http Proxy), there is a draft “DNS X-Proxied-For” available. Dnsdist supports this in the newServer command (addXPF), but pi-hole does not understand the “DNS X-Proxied-For” entry.

It would be cool if we could include “DNS X-Proxied-For” in pi-hole, then you could take advantage of dnsdist.

https://tools.ietf.org/id/draft-bellis-dnsop-xpf-02.html

https://dnsdist.org/index.html
https://dnsdist.org/reference/config.html?highlight=newserver#newServer
https://dnsdist.org/guides/dns-over-https.html
https://dnsdist.org/guides/dns-over-tls.html

https://blog.powerdns.com/2018/03/30/dnsdist-1-3-0-released/

https://dnsprivacy.org/wiki/m/mobile.action#page/1278004

Not sure whether it would be prudent to support this.

“DNS X-Proxied-For” is not a standard, not even an RFC yet. Its corresponding internet draft has been around since January 2017 and has expired in September 2018:

PROXY Protocol v2 support could also be a possibility.

Nginx should also support this (proxy_protocol on;)

And HAProxy