go-ipfs-config: add custom DNS Resolver configuration

This commit is contained in:
vyzo 2021-04-12 13:53:19 +03:00
parent 2690c10bca
commit 8a8b161da4
2 changed files with 11 additions and 0 deletions

View File

@ -28,6 +28,7 @@ type Config struct {
AutoNAT AutoNATConfig
Pubsub PubsubConfig
Peering Peering
DNS DNSConfig
Provider Provider
Reprovider Reprovider

10
config/dns.go Normal file
View File

@ -0,0 +1,10 @@
package config
// DNSConfig specifies custom resolvers using DoH
type DNSConfig struct {
// DefaultResolver, if present, is a URL for the default DoH resolver.
// If empty, DNS resolution will use the system resolver.
DefaultResolver string `json:",omitempty"`
// CustomResolvers is a map of domains to URLs for custom DoH resolution.
CustomResolvers map[string]string `json:",omitempty"`
}