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

DoH queries with numeric type fail #474

Closed
lidel opened this issue Mar 19, 2024 · 5 comments · Fixed by multiformats/js-dns#7
Closed

DoH queries with numeric type fail #474

lidel opened this issue Mar 19, 2024 · 5 comments · Fixed by multiformats/js-dns#7

Comments

@lidel
Copy link
Member

lidel commented Mar 19, 2024

Found DoH problem, seems we started sending a number instead of string value:

(type=16) produces no results:

$ curl -H 'accept: application/dns-json' -sS 'https://delegated-ipfs.dev/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":[]}

(type=TXT) produces valid results:

$ curl -H 'accept: application/dns-json' -sS 'https://delegated-ipfs.dev/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\""}]

Ref. https://developers.cloudflare.com/1.1.1.1/encryption/dns-over-https/make-api-requests/dns-json/ suggests both are allowed, but the resolver.cloudflare-eth.com we use for ENS only returns results for text.

Can we switch back to text? TXT is way easier to reason that some random number.

@SgtPooki
Copy link
Member

SgtPooki commented Mar 19, 2024

@lidel It seems like this is a bug in the delegated-ipfs.dev/dns-query server rather than helia/ipns implementation, because https://cloudflare-dns.com/dns-query accepts both:

This is a bug in https://resolver.cloudflare-eth.com/dns-query server rather than helia/ipns implementation:

╰─ ✔ ❯ curl -H 'accept: application/dns-json' -sS '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":[]}%

╰─ ✔ ❯ curl -H 'accept: application/dns-json' -sS '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\""}]}%

@SgtPooki
Copy link
Member

@SgtPooki
Copy link
Member

FYI that we can allow querying with TXT instead of 16 with the changes in multiformats/js-dns#5, but need to wait for it to propogate.

@lidel
Copy link
Member Author

lidel commented Mar 21, 2024

Thank you for cleaning this up upstream. In the meantime, I've come up with a quick and dirty fixup on our proxy's end: https://github.com/ipshipyard/waterworks-infra/pull/65

@achingbrain
Copy link
Member

Has anyone let CloudFlare know their gateway isn't compliant with their documentation?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants