wgengine/router: flushdns in windows when router config changes

Fixes: https://github.com/tailscale/tailscale/issues/1430

Signed-off-by: Aleksandar Pesic <peske.nis@gmail.com>
pull/1500/head
Aleksandar Pesic 3 years ago
parent d491adbf09
commit 25d2dd868b

@ -111,6 +111,14 @@ func (r *winRouter) Set(cfg *Config) error {
return fmt.Errorf("dns set: %w", err)
}
// Flush DNS on router config change to clear cached DNS entries (solves #1430)
out, err := exec.Command("ipconfig", "/flushdns").CombinedOutput()
if err != nil {
r.logf("flushdns error: %v; output: %s", err, out)
} else {
r.logf("flushdns successful")
}
return nil
}

Loading…
Cancel
Save