-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
feat: DNS.MaxCacheTTL for DNS-over-HTTPS resolvers #8615
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
Merged
Merged
Changes from 4 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
e7c4b48
feat: Add MaxCacheTTL option for DNS-over-HTTPS resolvers
thibmeu a31c284
Update libp2p/go-doh-resolver dependencies to support Options
thibmeu 9906198
feat: Add `DNS.MaxCacheTTL` config documentation
thibmeu 7f7f096
docs: DNS.MaxCacheTTL
lidel c9aa772
chore: [email protected]
lidel d5dc09b
docs: apply suggestions from review
lidel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -140,7 +140,8 @@ config file at runtime. | |
- [`Swarm.Transports.Multiplexers.Yamux`](#swarmtransportsmultiplexersyamux) | ||
- [`Swarm.Transports.Multiplexers.Mplex`](#swarmtransportsmultiplexersmplex) | ||
- [`DNS`](#dns) | ||
- [`DNS.Resolvers`](#dnsresolvers) | ||
- [`DNS.Resolvers`](#dnsresolvers) | ||
- [`DNS.MaxCacheTTL`](#dnsmaxcachettl) | ||
|
||
|
||
|
||
|
@@ -1757,7 +1758,7 @@ Type: `priority` | |
|
||
Options for configuring DNS resolution for [DNSLink](https://docs.ipfs.io/concepts/dnslink/) and `/dns*` [Multiaddrs](https://github.com/multiformats/multiaddr/). | ||
|
||
## `DNS.Resolvers` | ||
### `DNS.Resolvers` | ||
|
||
Map of [FQDNs](https://en.wikipedia.org/wiki/Fully_qualified_domain_name) to custom resolver URLs. | ||
|
||
|
@@ -1772,7 +1773,7 @@ Example: | |
"eth.": "https://eth.link/dns-query", | ||
"crypto.": "https://resolver.unstoppable.io/dns-query", | ||
"libre.": "https://ns1.iriseden.fr/dns-query", | ||
".": "https://doh-ch.blahdns.com:4443/dns-query" | ||
".": "https://cloudflare-dns.com/dns-query" | ||
} | ||
} | ||
} | ||
|
@@ -1785,11 +1786,28 @@ Be mindful that: | |
```json | ||
{ | ||
"eth.": "https://resolver.cloudflare-eth.com/dns-query", | ||
"crypto.": "https://resolver.cloudflare-eth.com/dns-query | ||
"crypto.": "https://resolver.cloudflare-eth.com/dns-query" | ||
} | ||
``` | ||
To get all the benefits of a decentralized naming system we strongly suggest setting DoH endpoint to an empty string and running own decentralized resolver as catch-all one on localhost. | ||
|
||
Default: `{}` | ||
|
||
Type: `object[string -> string]` | ||
|
||
### `DNS.MaxCacheTTL` | ||
|
||
Maximum duration entries are valid in the DoH cache. | ||
lidel marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
This allows to cap the Time-To-Live suggested by the DNS response ([RFC2181](https://datatracker.ietf.org/doc/html/rfc2181#section-8)). | ||
lidel marked this conversation as resolved.
Show resolved
Hide resolved
|
||
If present, the upper bound is applied to DoH resolvers in [`DNS.Resolvers`](#dnsresolvers). | ||
|
||
Note: This does NOT work with OS-level resolver. To make this a global setting, add `.` entry to `DNS.Resolvers` first. | ||
lidel marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
**Examples:** | ||
* `"5m"` DNS entries are kept for 5 minutes or less. | ||
* `"0s"` DNS entries expire as soon as they are retrieved. | ||
|
||
Default: Respect DNS Response TTL | ||
|
||
Type: `optionalDuration` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For completeness, can we add There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good idea, but opened #8729 to not block this PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.