Add .meship protocol support (#7) (#8)

* Add .meship protocol support (#7)

* Add an option to disable .meship resolver

Co-authored-by: George <zhoreeq@users.noreply.github.com>
This commit is contained in:
George
2021-04-05 00:58:46 -04:00
committed by GitHub
parent cc15ec8496
commit c56ec05ae7
2 changed files with 57 additions and 21 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)