mirror of https://github.com/dnomd343/XProxy.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
406 B
19 lines
406 B
package network
|
|
|
|
import (
|
|
"XProxy/cmd/common"
|
|
log "github.com/sirupsen/logrus"
|
|
)
|
|
|
|
func loadDns(dns []string) {
|
|
if len(dns) == 0 { // without dns server
|
|
log.Info("Using system DNS server")
|
|
return
|
|
}
|
|
log.Infof("Setting up DNS server -> %v", dns)
|
|
dnsConfig := ""
|
|
for _, dnsAddr := range dns {
|
|
dnsConfig += "nameserver " + dnsAddr + "\n"
|
|
}
|
|
common.WriteFile("/etc/resolv.conf", dnsConfig, true)
|
|
}
|
|
|