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.

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