MCPcopy
hub / github.com/nextdns/nextdns / SetDNS

Function SetDNS

host/dns_bsd.go:108–119  ·  view source on GitHub ↗
(dns string, port uint16)

Source from the content-addressed store, hash-verified

106}
107
108func SetDNS(dns string, port uint16) error {
109 if port != 53 {
110 return fmt.Errorf("setup resolv.conf: non 53 port not supported on this platform")
111 }
112 if err := setupResolvConf(dns); err != nil {
113 return fmt.Errorf("setup resolv.conf: %v", err)
114 }
115 if err := setupResolvconfConf(); err != nil {
116 return fmt.Errorf("setup resolvconf.conf: %v", err)
117 }
118 return updateResolvconf()
119}
120
121func ResetDNS() error {
122 if err := os.Rename(resolvBackupFile, resolvFile); err != nil {

Callers

nothing calls this directly

Calls 4

setupResolvConfFunction · 0.85
setupResolvconfConfFunction · 0.85
updateResolvconfFunction · 0.85
ErrorfMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…