plugin/forward: Add http(2) host/authority header and TO server resolution
What would you like to be added:
Add http/2 :authority header mapped to the hostname for the desired TO Allow resolution of the TO server defined Force DNS ID to 0 for https requests
Why is this needed:
I decided to start testing the DoH capability added in #8004 and had success with public DoH providers, but the one I need to use was returning the REFUSED rcode for all requests.
I compared the http payload with firefox which was working just fine and found that the :authority field was populated with the IP address of the destination TO server as well as the DNS ID was the same as the client request received by my coreDNS instance. The other difference i found was that Firefox padded to 4096 bytes while CoreDNS kept the message size minimal.
I iterated through each of the differences and found that the DNS transaction ID was perhaps not the issue, the TLS connection was established successfully so the tls_servername configuration was working as intended. Once I was able to get the servername inserted into the http request creation, the dns response was successful.
Another issue that compounded the problem was this provider also does not add IP information to the SAN in their certificate, relying only on a wildcard subject.
edit: I'll add my PR from my fork shortly with working code once i make sure tests pass etc. didn't mean to submit just yet
Source: coredns/coredns