MCPcopy
hub / github.com/nextdns/nextdns / setDNS

Function setDNS

host/dns_darwin.go:42–48  ·  view source on GitHub ↗
(networkService, dns string)

Source from the content-addressed store, hash-verified

40}
41
42func setDNS(networkService, dns string) error {
43 b, err := exec.Command("networksetup", "-setdnsservers", networkService, dns).Output()
44 if err != nil {
45 return errors.New(string(b))
46 }
47 return nil
48}
49
50func listNetworkServices() ([]string, error) {
51 b, err := exec.Command("networksetup", "-listallnetworkservices").Output()

Callers 1

SetDNSFunction · 0.70

Calls 1

CommandMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…