Add an option to disable .meship resolver

This commit is contained in:
George
2021-04-02 16:35:22 -04:00
parent 61c74e0568
commit 4e4e6f63ba
2 changed files with 28 additions and 23 deletions
+3 -2
View File
@@ -38,7 +38,7 @@ func loadConfig(s *meshname.MeshnameServer, confPath string) error {
var (
genconf, subdomain, useconffile, listenAddr, networksconf string
debug, allowRemote bool
debug, noMeshIP, allowRemote bool
)
func init() {
@@ -47,6 +47,7 @@ func init() {
flag.StringVar(&useconffile, "useconffile", "", "run daemon with a config file")
flag.StringVar(&listenAddr, "listenaddr", "[::1]:53535", "address to listen on")
flag.StringVar(&networksconf, "networks", "ygg=200::/7,cjd=fc00::/8,meshname=::/0", "TLD=subnet list separated by comma")
flag.BoolVar(&noMeshIP, "nomeship", false, "disable .meship resolver")
flag.BoolVar(&allowRemote, "allowremote", false, "allow remote queries from any IP address")
flag.BoolVar(&debug, "debug", false, "enable debug logging")
}
@@ -77,7 +78,7 @@ func main() {
logger.Fatalln(err)
}
s := meshname.New(logger, listenAddr, networks, allowRemote)
s := meshname.New(logger, listenAddr, networks, !noMeshIP, allowRemote)
if useconffile != "" {
if err := loadConfig(s, useconffile); err != nil {
logger.Fatalln(err)