mirror of https://github.com/dnomd343/XProxy.git
dnomd343
2 years ago
3 changed files with 17 additions and 16 deletions
@ -1,19 +1,19 @@ |
|||||
package network |
package network |
||||
|
|
||||
import ( |
import ( |
||||
"XProxy/cmd/common" |
"XProxy/cmd/common" |
||||
log "github.com/sirupsen/logrus" |
log "github.com/sirupsen/logrus" |
||||
) |
) |
||||
|
|
||||
func loadDns(dns []string) { |
func loadDns(dns []string) { |
||||
if len(dns) == 0 { // without dns server
|
if len(dns) == 0 { // without dns server
|
||||
log.Info("Using system DNS server") |
log.Info("Using system DNS server") |
||||
return |
return |
||||
} |
} |
||||
log.Infof("Setting up DNS server -> %v", dns) |
log.Infof("Setting up DNS server -> %v", dns) |
||||
dnsConfig := "" |
dnsConfig := "" |
||||
for _, dnsAddr := range dns { |
for _, dnsAddr := range dns { |
||||
dnsConfig += "nameserver " + dnsAddr + "\n" |
dnsConfig += "nameserver " + dnsAddr + "\n" |
||||
} |
} |
||||
common.WriteFile("/etc/resolv.conf", dnsConfig, true) |
common.WriteFile("/etc/resolv.conf", dnsConfig, true) |
||||
} |
} |
||||
|
Loading…
Reference in new issue