diff --git a/config/config.go b/config/config.go index 7d44316abd33..b593e7a7e360 100644 --- a/config/config.go +++ b/config/config.go @@ -28,6 +28,7 @@ type Config struct { AutoNAT AutoNATConfig Pubsub PubsubConfig Peering Peering + DNS DNS Provider Provider Reprovider Reprovider diff --git a/config/dns.go b/config/dns.go new file mode 100644 index 000000000000..5c4e62da0cc9 --- /dev/null +++ b/config/dns.go @@ -0,0 +1,15 @@ +package config + +// 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 + // + // Example: + // - Custom resolver for ENS: `eth.` → `https://eth.link/dns-query` + // - Override the default OS resolver: `.` → `https://doh.applied-privacy.net/query` + Resolvers map[string]string +} diff --git a/config/init.go b/config/init.go index ecda3047ddbe..56a99884fa84 100644 --- a/config/init.go +++ b/config/init.go @@ -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