mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-05-15 00:50:25 +02:00
all: preserve DNS settings when running "ctrld restart"
By attempting to reset DNS before starting new ctrld process. This way, ctrld will read the correct system DNS settings before changing itself. While at it, some optimizations are made: - "ctrld start" won't set DNS anymore, since "ctrld run" has already did this, start command could just query socket control server and emittin proper message to users. - The gateway won't be included as nameservers on Windows anymore, since the GetAdaptersAddresses Windows API always returns the correct DNS servers of the interfaces. - The nameservers list that OS resolver is using will be shown during ctrld startup, making it easier for debugging.
This commit is contained in:
committed by
Cuong Manh Le
parent
f3dd344026
commit
96085147ff
+5
-1
@@ -32,8 +32,12 @@ const (
|
||||
|
||||
const bootstrapDNS = "76.76.2.22"
|
||||
|
||||
// OsNameservers is the list of DNS nameservers used by OS resolver.
|
||||
// This reads OS settings at the time ctrld process starts.
|
||||
var OsNameservers = defaultNameservers()
|
||||
|
||||
// or is the Resolver used for ResolverTypeOS.
|
||||
var or = &osResolver{nameservers: defaultNameservers()}
|
||||
var or = &osResolver{nameservers: OsNameservers}
|
||||
|
||||
// defaultNameservers returns OS nameservers plus ctrld bootstrap nameserver.
|
||||
func defaultNameservers() []string {
|
||||
|
||||
Reference in New Issue
Block a user