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>
This commit is contained in:
Aleksandar Pesic 2021-03-10 10:44:38 +01:00
parent d491adbf09
commit 25d2dd868b

View File

@ -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
}