From 8a8b161da461c8e340f7a37178df3e1ea882fad9 Mon Sep 17 00:00:00 2001 From: vyzo Date: Mon, 12 Apr 2021 13:53:19 +0300 Subject: [PATCH] go-ipfs-config: add custom DNS Resolver configuration --- config/config.go | 1 + config/dns.go | 10 ++++++++++ 2 files changed, 11 insertions(+) create mode 100644 config/dns.go diff --git a/config/config.go b/config/config.go index 7d44316ab..d9b060e64 100644 --- a/config/config.go +++ b/config/config.go @@ -28,6 +28,7 @@ type Config struct { AutoNAT AutoNATConfig Pubsub PubsubConfig Peering Peering + DNS DNSConfig Provider Provider Reprovider Reprovider diff --git a/config/dns.go b/config/dns.go new file mode 100644 index 000000000..5f18a9c69 --- /dev/null +++ b/config/dns.go @@ -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"` +}