From 084e6d6119aeb42b3bb5af8134a98ce74d1507b3 Mon Sep 17 00:00:00 2001 From: Alvaro Saurin Date: Mon, 20 Apr 2015 17:52:16 +0200 Subject: [PATCH 1/3] Documented the local domain argument --- weavedns/README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/weavedns/README.md b/weavedns/README.md index 83576f7c..2e68699b 100644 --- a/weavedns/README.md +++ b/weavedns/README.md @@ -134,6 +134,20 @@ that you can use unqualified hostnames. Use `--dns-search=.` to make the resolver use the container's domain, or e.g., `--dns-search=weave.local` to make it look in `weave.local`. +### Using a different local domain + +By default, WeaveDNS uses `weave.local.` as the domain for local +records. In general users do not need to change this domain, but you +can force WeaveDNS to use a different domain by launching it +with the `--localDomain` argument. For example, + +```bash +$ weave launch-dns 10.2.254.1/24 --localDomain="mycompany.local." +``` + +The local domain should end with the `local.` suffix (it is +not strictly neccessary). + ### Adding containers to DNS If DNS is started after you've attached a container to the weave From cc4ba53d1bd86bb1a5d15c02c7f215c18d6af750 Mon Sep 17 00:00:00 2001 From: Alvaro Saurin Date: Mon, 20 Apr 2015 20:14:04 +0200 Subject: [PATCH 2/3] Minor improvements in the docs --- weavedns/README.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/weavedns/README.md b/weavedns/README.md index 2e68699b..1eb8b262 100644 --- a/weavedns/README.md +++ b/weavedns/README.md @@ -136,17 +136,18 @@ the resolver use the container's domain, or e.g., ### Using a different local domain -By default, WeaveDNS uses `weave.local.` as the domain for local -records. In general users do not need to change this domain, but you +By default, WeaveDNS uses `weave.local.` as the domain for names on the +Weave network. In general users do not need to change this domain, but you can force WeaveDNS to use a different domain by launching it -with the `--localDomain` argument. For example, +with the `--domain` argument. For example, ```bash -$ weave launch-dns 10.2.254.1/24 --localDomain="mycompany.local." +$ weave launch-dns 10.2.254.1/24 --domain="mycompany.local." ``` -The local domain should end with the `local.` suffix (it is -not strictly neccessary). +The local domain should end with `local.`, since these names are +link-local as per [RFC6762](https://tools.ietf.org/html/rfc6762), +(though this is not strictly neccessary). ### Adding containers to DNS From 6fd90d45a16f2f551ece2e15d1d3d96ad9cb82e1 Mon Sep 17 00:00:00 2001 From: Alvaro Saurin Date: Mon, 20 Apr 2015 20:14:20 +0200 Subject: [PATCH 3/3] Renamed --localDomain to --domain --- weavedns/main.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/weavedns/main.go b/weavedns/main.go index 476282b8..b7ae993a 100644 --- a/weavedns/main.go +++ b/weavedns/main.go @@ -21,7 +21,7 @@ func main() { justVersion bool ifaceName string apiPath string - localDomain string + domain string dnsPort int httpPort int wait int @@ -36,7 +36,7 @@ func main() { flag.BoolVar(&justVersion, "version", false, "print version and exit") 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.StringVar(&localDomain, "localDomain", weavedns.DefaultLocalDomain, "local domain (ie, 'weave.local.')") + flag.StringVar(&domain, "domain", weavedns.DefaultLocalDomain, "local domain (ie, 'weave.local.')") flag.IntVar(&wait, "wait", 0, "number of seconds to wait for interface to be created and come up") flag.IntVar(&dnsPort, "dnsport", weavedns.DefaultServerPort, "port to listen to DNS requests") flag.IntVar(&httpPort, "httpport", 6785, "port to listen to HTTP requests") @@ -79,7 +79,7 @@ func main() { srvConfig := weavedns.DNSServerConfig{ Port: dnsPort, CacheLen: cacheLen, - LocalDomain: localDomain, + LocalDomain: domain, Timeout: timeout, UDPBufLen: udpbuf, } @@ -93,7 +93,7 @@ func main() { Debug.Printf("Starting the signals handler") go handleSignals(srv) - go weavedns.ListenHTTP(version, srv, localDomain, zone, httpPort) + go weavedns.ListenHTTP(version, srv, domain, zone, httpPort) err = srv.Start() if err != nil { Error.Fatal("Failed to start the WeaveDNS server", err)