Fix: updater uses plaintext DNS to avoid getting blocked by Unbound (#380)

This commit is contained in:
Quentin McGaw
2021-02-12 14:20:07 -05:00
committed by GitHub
parent 576400e0d9
commit fe5ec205fc
2 changed files with 9 additions and 1 deletions

View File

@@ -85,6 +85,10 @@ func (settings *Settings) Read(env params.Env, os os.OS, logger logging.Logger)
return err return err
} }
if ip := settings.DNS.PlaintextAddress; ip != nil {
settings.Updater.DNSAddress = ip.String()
}
if err := settings.PublicIP.read(r); err != nil { if err := settings.PublicIP.read(r); err != nil {
return err return err
} }

View File

@@ -51,7 +51,11 @@ func (settings *Updater) read(r reader) (err error) {
settings.Windscribe = true settings.Windscribe = true
settings.Stdout = false settings.Stdout = false
settings.CLI = false settings.CLI = false
settings.DNSAddress = "127.0.0.1" // use cloudflare in plaintext to not be blocked by DNS over TLS by default.
// If a plaintext address is set in the DNS settings, this one will be used.
// TODO use custom future encrypted DNS written in Go without blocking
// as it's too much trouble to start another parallel unbound instance for now.
settings.DNSAddress = "1.1.1.1"
settings.Period, err = r.env.Duration("UPDATER_PERIOD", params.Default("0")) settings.Period, err = r.env.Duration("UPDATER_PERIOD", params.Default("0"))
if err != nil { if err != nil {