New zone database

This commit is contained in:
Alvaro Saurin committed 2015-05-26 10:53:12 +02:00
1 parent 9c48c83701
commit 8a509168ee
8 files changed
+791 -148

No files matched your search

+21 -9
View File
@@ -52,15 +52,6 @@ func main() {
InitDefaultLogging(debug)
Info.Printf("WeaveDNS version %s\n", version) // first thing in log: the version
var zone = weavedns.NewZoneDb(domain)
if watch {
err := updater.Start(apiPath, zone)
if err != nil {
Error.Fatal("Unable to start watcher", err)
}
}
var iface *net.Interface
if ifaceName != "" {
var err error
@@ -73,6 +64,27 @@ func main() {
}
}
zoneConfig := weavedns.ZoneConfig{
Domain: domain,
Iface: iface,
}
zone, err := weavedns.NewZoneDb(zoneConfig)
if err != nil {
Error.Fatal("[main] Unable to initialize the Zone database", err)
}
err = zone.Start()
if err != nil {
Error.Fatal("[main] Unable to start the Zone database", err)
}
defer zone.Stop()
if watch {
err := updater.Start(apiPath, zone)
if err != nil {
Error.Fatal("[main] Unable to start watcher", err)
}
}
srvConfig := weavedns.DNSServerConfig{
Port: dnsPort,
CacheLen: cacheLen,