zettio/weave#362 - reorganize the DNS server code, so it looks like the mDNS server, with a proper class with Start() and so...
Listen on TCP on port 53 by default
This commit is contained in:
1 parent
e485e68946
commit
3be5600383
3 files changed
+100
-61
No files matched your search
+10
-3
@@ -18,7 +18,8 @@ func main() {
|
||||
justVersion bool
|
||||
ifaceName string
|
||||
apiPath string
|
||||
dnsPort int
|
||||
udpPort int
|
||||
tcpPort int
|
||||
httpPort int
|
||||
wait int
|
||||
watch bool
|
||||
@@ -29,7 +30,8 @@ func main() {
|
||||
flag.StringVar(&ifaceName, "iface", "", "name of interface to use for multicast")
|
||||
flag.StringVar(&apiPath, "api", "unix:///var/run/docker.sock", "Path to Docker API socket")
|
||||
flag.IntVar(&wait, "wait", 0, "number of seconds to wait for interface to be created and come up")
|
||||
flag.IntVar(&dnsPort, "dnsport", 53, "port to listen to dns requests")
|
||||
flag.IntVar(&udpPort, "udpport", 53, "UDP port to listen to DNS requests")
|
||||
flag.IntVar(&tcpPort, "tcpport", 53, "TCP port to listen to DNS requests")
|
||||
flag.IntVar(&httpPort, "httpport", 6785, "port to listen to HTTP requests")
|
||||
flag.BoolVar(&watch, "watch", true, "watch the docker socket for container events")
|
||||
flag.BoolVar(&debug, "debug", false, "output debugging info to stderr")
|
||||
@@ -64,7 +66,12 @@ func main() {
|
||||
}
|
||||
|
||||
go weavedns.ListenHttp(weavedns.LOCAL_DOMAIN, zone, httpPort)
|
||||
err := weavedns.StartServer(zone, iface, dnsPort, wait)
|
||||
srv, err := weavedns.NewDNSServer(zone, iface, udpPort, tcpPort)
|
||||
if err != nil {
|
||||
Error.Fatal("Failed to start server", err)
|
||||
}
|
||||
|
||||
srv.Start()
|
||||
if err != nil {
|
||||
Error.Fatal("Failed to start server", err)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user