mirror of
https://github.com/tailscale/tailscale.git
synced 2024-11-26 19:45:35 +00:00
20 lines
429 B
Go
20 lines
429 B
Go
|
// Copyright (c) 2021 Tailscale Inc & AUTHORS All rights reserved.
|
||
|
// Use of this source code is governed by a BSD-style
|
||
|
// license that can be found in the LICENSE file.
|
||
|
|
||
|
package dns
|
||
|
|
||
|
import (
|
||
|
"fmt"
|
||
|
"os/exec"
|
||
|
)
|
||
|
|
||
|
// Flush clears the local resolver cache.
|
||
|
func Flush() error {
|
||
|
out, err := exec.Command("ipconfig", "/flushdns").CombinedOutput()
|
||
|
if err != nil {
|
||
|
return fmt.Errorf("%v (output: %s)", err, out)
|
||
|
}
|
||
|
return nil
|
||
|
}
|