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

DNS-JSON over HTTP type should be number or string as per the docs #13778

Closed
achingbrain opened this issue Apr 3, 2024 · 1 comment
Closed
Assignees
Labels
content:edit Request for content edits documentation Documentation edits product:1.1.1.1 Related to 1.1.1.1 product

Comments

@achingbrain
Copy link

Existing documentation URL(s)

https://developers.cloudflare.com/1.1.1.1/encryption/dns-over-https/make-api-requests/dns-json/

What changes are you suggesting?

Clarify the type parameter type. According to the docs it can be a number or a string but some Cloudflare services only support strings.

Either the docs need to specify this, or all services need to support both as per the docs.

Additional information

The type field in the supported parameter table says it can be a number or a string.

For regular DNS requests this works:

type=TXT

% curl -H "accept: application/dns-json" "https://cloudflare-dns.com/dns-query?name=example.com&type=TXT"
{"Status":0,"TC":false,"RD":true,"RA":true,"AD":true,"CD":false,"Question":[{"name":"example.com","type":16}],"Answer":[{"name":"example.com","type":16,"TTL":86400,"data":"\"v=spf1 -all\""},{"name":"example.com","type":16,"TTL":86400,"data":"\"wgyf8z8cgvm2qmxpnbnldrcltvk4xqfn\""}]}%  -

type=16

% curl -H "accept: application/dns-json" "https://cloudflare-dns.com/dns-query?name=example.com&type=16" 
{"Status":0,"TC":false,"RD":true,"RA":true,"AD":true,"CD":false,"Question":[{"name":"example.com","type":16}],"Answer":[{"name":"example.com","type":16,"TTL":86400,"data":"\"v=spf1 -all\""},{"name":"example.com","type":16,"TTL":86400,"data":"\"wgyf8z8cgvm2qmxpnbnldrcltvk4xqfn\""}]}%     

For ENS names it does not work:

type=TXT

% curl -H "accept: application/dns-json" "https://resolver.cloudflare-eth.com/dns-query?name=_dnslink.almonit.eth&type=TXT"
{"AD":true,"CD":false,"RA":true,"RD":true,"TC":false,"Status":0,"Question":[{"name":"_dnslink.almonit.eth.","type":16}],"Answer":[{"name":"_dnslink.almonit.eth","type":16,"TTL":3600,"data":"\"a=0xb365d73dcc34b2ea5E3969687954240e187B43eA\""}]}%

type=16

% curl -H "accept: application/dns-json" "https://resolver.cloudflare-eth.com/dns-query?name=_dnslink.almonit.eth&type=16"
{"AD":true,"CD":false,"RA":true,"RD":true,"TC":false,"Status":2,"Question":[{"name":"_dnslink.almonit.eth.","type":"TXT"}],"Answer":[]}%

In the second response, the answer type also changes from 16 to "TXT".

Refs: ipfs/helia#474

@achingbrain achingbrain added content:edit Request for content edits documentation Documentation edits labels Apr 3, 2024
@github-actions github-actions bot added the product:1.1.1.1 Related to 1.1.1.1 product label Apr 3, 2024
@RebeccaTamachiro
Copy link
Contributor

Hey @achingbrain 👋 Thanks for flagging this.
I have raised it internally and the team is looking into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
content:edit Request for content edits documentation Documentation edits product:1.1.1.1 Related to 1.1.1.1 product
Projects
None yet
Development

No branches or pull requests

2 participants