mirror of
https://github.com/Control-D-Inc/ctrld.git
synced 2026-02-03 22:18:39 +00:00
cmd/ctrld: do not change DNS for tailscale0
Let user decide which option is prefer.
This commit is contained in:
committed by
Cuong Manh Le
parent
dc7d77b22e
commit
49e9b8b51c
@@ -26,16 +26,10 @@ import (
|
||||
"github.com/Control-D-Inc/ctrld/internal/controld"
|
||||
)
|
||||
|
||||
const (
|
||||
tailscaleDevName = "tailscale0"
|
||||
tailscaleDNS = "100.100.100.100"
|
||||
)
|
||||
|
||||
var (
|
||||
v = viper.NewWithOptions(viper.KeyDelimiter("::"))
|
||||
defaultConfigWritten = false
|
||||
defaultConfigFile = "ctrld.toml"
|
||||
tailscaleIface *net.Interface
|
||||
)
|
||||
|
||||
var basicModeFlags = []string{"listen", "primary_upstream", "secondary_upstream", "domains", "log", "cache_size"}
|
||||
@@ -612,9 +606,6 @@ func netIfaceFromName(ifaceName string) (*net.Interface, error) {
|
||||
if i.Name == ifaceName {
|
||||
iface = i.Interface
|
||||
}
|
||||
if i.Name == tailscaleDevName {
|
||||
tailscaleIface = i.Interface
|
||||
}
|
||||
})
|
||||
if iface == nil {
|
||||
return nil, errors.New("interface not found")
|
||||
|
||||
@@ -46,12 +46,6 @@ func (p *prog) run() {
|
||||
}
|
||||
}
|
||||
}
|
||||
// Sorry, tailscale!
|
||||
if tailscaleIface != nil {
|
||||
if err := setDNS(tailscaleIface, []string{cfg.Listener["0"].IP}); err != nil {
|
||||
mainLog.Warn().Err(err).Msg("could not set DNS for tailscale interface")
|
||||
}
|
||||
}
|
||||
|
||||
if p.cfg.Service.CacheEnable {
|
||||
cacher, err := dnscache.NewLRUCache(p.cfg.Service.CacheSize)
|
||||
|
||||
Reference in New Issue
Block a user