Skip to content

Commit

Permalink
go-ipfs-config: add default empty config for DNS, rename struct from …
Browse files Browse the repository at this point in the history
…DNSConfig to DNS
  • Loading branch information
vyzo committed Apr 14, 2021
1 parent 72eb404 commit 7bc2d44
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type Config struct {
AutoNAT AutoNATConfig
Pubsub PubsubConfig
Peering Peering
DNS DNSConfig
DNS DNS

Provider Provider
Reprovider Reprovider
Expand Down
10 changes: 5 additions & 5 deletions config/dns.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package config

// DNSConfig specifies DNS resolution rules using custom resolvers
type DNSConfig struct {
// Resolvers is a map of FQDNs to URLs for custom DNS resolution.
// DNS specifies DNS resolution rules using custom resolvers
type DNS struct {
// Resolvers is a map of FQDNs to URLs for custom DNS resolution.
// URLs starting with `https://` indicate DoH endpoints.
// Support for other resolver types can be added in the future.
// https://en.wikipedia.org/wiki/Fully_qualified_domain_name
// https://en.wikipedia.org/wiki/DNS_over_HTTPS
//
// https://en.wikipedia.org/wiki/DNS_over_HTTPS
//
// Example:
// - Custom resolver for ENS: `eth.` → `https://eth.link/dns-query`
// - Override the default OS resolver: `.` → `https://doh.applied-privacy.net/query`
Expand Down
3 changes: 3 additions & 0 deletions config/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ func InitWithIdentity(identity Identity) (*Config, error) {
Pinning: Pinning{
RemoteServices: map[string]RemotePinningService{},
},
DNS: DNS{
Resolvers: map[string]string{},
},
}

return conf, nil
Expand Down

0 comments on commit 7bc2d44

Please sign in to comment.