Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support DNS over HTTPS - RFC8484 #169

Closed
13 of 14 tasks
yaleman opened this issue Feb 20, 2023 · 0 comments
Closed
13 of 14 tasks

Support DNS over HTTPS - RFC8484 #169

yaleman opened this issue Feb 20, 2023 · 0 comments
Assignees

Comments

@yaleman
Copy link
Owner

yaleman commented Feb 20, 2023

Methods / Routes

Requirements

  • handle the Accept request header
    • standard response is application/dns-message
    • also respond to application/dns-json?
  • all valid DNS responses get a HTTP/200, even with a DNS message whose DNS rcode indicates failure, such as SERVFAIL or NXDOMAIN.
  • HTTP 406 should come back if the "Accept" type doesn't match a supported one.
  • HTTP 401 is to be used for REFUSED responses.
  • The TTL shall be returned in the cache-control header - eg cache-control = max-age=3709
    • and should be the lowest in an RRSET (but I'm pretty sure that's handled by the datastore responder)
    • and should respect the SOA minimum if it's an empty response
  • maximum size of the DNS message is 65535 bytes.

References

Examples

JSON response

curl -s -H 'accept: application/dns-json' 'https://cloudflare-dns.com/dns-query?name=example.com&type=A' | jq .

{
  "Status": 0,
  "TC": false,
  "RD": true,
  "RA": true,
  "AD": true,
  "CD": false,
  "Question": [
    {
      "name": "example.com",
      "type": 1
    }
  ],
  "Answer": [
    {
      "name": "example.com",
      "type": 1,
      "TTL": 74831,
      "data": "93.184.216.34"
    }
  ]
}

"traditional one"

curl -sH 'accept: application/dns-message' 'https://dns.google/dns-query?dns=q80BAAABAAAAAAAAA3d3dwdleGFtcGxlA2NvbQAAAQAB'  | hexdump -c

0000000   �   � 201 200  \0 001  \0 001  \0  \0  \0  \0 003   w   w   w
0000010  \a   e   x   a   m   p   l   e 003   c   o   m  \0  \0 001  \0
0000020 001   �  \f  \0 001  \0 001  \0  \0   Q   �  \0 004   ]   �   �
0000030   "
0000031
@yaleman yaleman self-assigned this Feb 20, 2023
yaleman added a commit that referenced this issue Feb 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant