(dns string, port uint16)
| 106 | } |
| 107 | |
| 108 | func 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 | |
| 121 | func ResetDNS() error { |
| 122 | if err := os.Rename(resolvBackupFile, resolvFile); err != nil { |
nothing calls this directly
no test coverage detected
searching dependent graphs…