mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-10-12 01:58:46 +02:00
The journal records the network state of the host and each change of that state. The support team reads one file to see the interfaces, the routes, the resolvers, and the recoveries around an incident. The same file shows the health of the query path. A change that touches only AirDrop or virtual interfaces runs no DNS work.
23 lines
529 B
Go
23 lines
529 B
Go
package cli
|
|
|
|
import (
|
|
"bytes"
|
|
"context"
|
|
"os/exec"
|
|
"time"
|
|
)
|
|
|
|
// scutilDNSTimeout bounds the read. scutil talks to the configuration daemon,
|
|
// and that daemon stalls while the network moves.
|
|
const scutilDNSTimeout = 5 * time.Second
|
|
|
|
func runSCUtilDNS() ([]dnsResolverEntry, error) {
|
|
ctx, cancel := context.WithTimeout(context.Background(), scutilDNSTimeout)
|
|
defer cancel()
|
|
out, err := exec.CommandContext(ctx, "scutil", "--dns").Output()
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
return parseSCUtilDNS(bytes.NewReader(out))
|
|
}
|