mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-07-04 01:07:49 +02:00
cmd/cli: watch resolv.conf on all unix platforms
This commit is contained in:
committed by
Cuong Manh Le
parent
8f189c919a
commit
7dc5138e91
@@ -468,6 +468,13 @@ func (p *prog) setDNS() {
|
||||
return
|
||||
}
|
||||
logger.Debug().Msg("setting DNS successfully")
|
||||
if shouldWatchResolvconf() {
|
||||
servers := make([]netip.Addr, len(nameservers))
|
||||
for i := range nameservers {
|
||||
servers[i] = netip.MustParseAddr(nameservers[i])
|
||||
}
|
||||
go watchResolvConf(netIface, servers, setResolvConf)
|
||||
}
|
||||
if allIfaces {
|
||||
withEachPhysicalInterfaces(netIface.Name, "set DNS", func(i *net.Interface) error {
|
||||
return setDNS(i, nameservers)
|
||||
|
||||
Reference in New Issue
Block a user