mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-02-03 22:18:39 +00:00
cmd/cli: re-initializing OS resolver before doing check upstream
Otherwise, the check will be done for old stale nameservers, causing it never succeed.
This commit is contained in:
committed by
Cuong Manh Le
parent
3ea69b180c
commit
6046789fa4
@@ -86,6 +86,10 @@ func (p *prog) checkUpstream(upstream string, uc *ctrld.UpstreamConfig) {
|
||||
p.um.mu.Unlock()
|
||||
}()
|
||||
|
||||
if uc.Type == ctrld.ResolverTypeOS {
|
||||
ns := ctrld.InitializeOsResolver()
|
||||
mainLog.Load().Debug().Msgf("re-initializing OS resolver with nameservers: %v", ns)
|
||||
}
|
||||
resolver, err := ctrld.NewResolver(uc)
|
||||
if err != nil {
|
||||
mainLog.Load().Warn().Err(err).Msg("could not check upstream")
|
||||
|
||||
Reference in New Issue
Block a user