mirror of
https://github.com/gravitl/netmaker.git
synced 2024-09-20 15:26:04 +08:00
one time CoreDNS file
This commit is contained in:
parent
12493680fb
commit
70afe33246
|
@ -48,6 +48,7 @@ type ServerConfig struct {
|
|||
AgentBackend string `yaml:"agentbackend"`
|
||||
ClientMode string `yaml:"clientmode"`
|
||||
DNSMode string `yaml:"dnsmode"`
|
||||
SplitDNS string `yaml:"splitdns"`
|
||||
DisableRemoteIPCheck string `yaml:"disableremoteipcheck"`
|
||||
DisableDefaultNet string `yaml:"disabledefaultnet"`
|
||||
GRPCSSL string `yaml:"grpcssl"`
|
||||
|
|
|
@ -8,6 +8,7 @@ import (
|
|||
"github.com/gravitl/netmaker/database"
|
||||
"github.com/gravitl/netmaker/functions"
|
||||
"github.com/gravitl/netmaker/models"
|
||||
"github.com/gravitl/netmaker/servercfg"
|
||||
"github.com/txn2/txeh"
|
||||
)
|
||||
|
||||
|
@ -161,8 +162,9 @@ func SetDNS() error {
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
err = functions.SetCorefile(corefilestring)
|
||||
|
||||
if servercfg.IsSplitDNS() {
|
||||
err = functions.SetCorefile(corefilestring)
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ func SetDNSDir() error {
|
|||
}
|
||||
_, err = os.Stat(dir + "/config/dnsconfig/Corefile")
|
||||
if os.IsNotExist(err) {
|
||||
err = SetCorefile("example.com")
|
||||
err = SetCorefile(".")
|
||||
if err != nil {
|
||||
PrintUserLog("",err.Error(),0)
|
||||
}
|
||||
|
|
|
@ -345,3 +345,13 @@ func GetSQLConn() string {
|
|||
}
|
||||
return sqlconn
|
||||
}
|
||||
|
||||
func IsSplitDNS() bool {
|
||||
issplit := false
|
||||
if os.Getenv("IS_SPLIT_DNS") == "yes" {
|
||||
issplit = true
|
||||
} else if config.Config.Server.SplitDNS == "yes" {
|
||||
issplit = true
|
||||
}
|
||||
return issplit
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue