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

Add TTL to /api/v0/dns #5884

Closed
lidel opened this issue Jan 2, 2019 · 3 comments
Closed

Add TTL to /api/v0/dns #5884

lidel opened this issue Jan 2, 2019 · 3 comments
Labels
exp/expert Having worked on the specific codebase is important good first issue Good issue for new contributors help wanted Seeking public contribution on this issue

Comments

@lidel
Copy link
Member

lidel commented Jan 2, 2019

Version information:

0.4.18

Type:

enhancement

Description:

Historical background can be found in #1054

DNS query API at /api/v0/dns resolves FQDN to IPFS path (if DNSLink exists).

It is heavily used by ipfs-companion however we don't know for how long DNSLink (DNS TXT record) is valid and use a static cache expiration value, which has its downsides.

Ideally, we would add an opt-in --ttl flag to extend response of /api/v0/dns and use actual TTL in cache expiration logic.

A response with --ttl could look like this:

{
  "Path": "/ipfs/QmS4fTD7Rh8NouNhp9uZbawUdBpgHaUTeL3EnxX8Tiiu7H",
  "TTL": 60,
}

For what its worth I did a quick check and go-ipfs/namesys uses net.LookupTXT which returns strings with text, but no TTL, so I imagine standard library is not enough, and we would have to introduce more advanced DNS library to make this work.

Does this sound feasible on go-ipfs end?
What would be the next step?

@magik6k
Copy link
Member

magik6k commented Jan 2, 2019

This probably is going to be a bit more involved since the default Go resolver doesn't expose TTL - https://golang.org/pkg/net/#LookupTXT and I don't see any obvious workaround

@magik6k magik6k added the help wanted Seeking public contribution on this issue label Jan 2, 2019
@bonedaddy
Copy link
Contributor

if another DNS library needs to be used https://github.com/miekg/dns looks pretty thorough

@lidel
Copy link
Member Author

lidel commented Dec 12, 2023

/api/v0/dns will be removed in Kubo 0.26
Details in #10253

If TTL read is needed, standalone DNS lookup needs to happen (in case of go DoH).

@lidel lidel closed this as not planned Won't fix, can't repro, duplicate, stale Dec 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exp/expert Having worked on the specific codebase is important good first issue Good issue for new contributors help wanted Seeking public contribution on this issue
Projects
No open projects
Development

No branches or pull requests

4 participants