From 14ec3290fa94b244e47165fb57d808c6b21c9e13 Mon Sep 17 00:00:00 2001 From: sweeneyb Date: Fri, 5 Aug 2016 19:36:01 +0000 Subject: [PATCH] Add support for dns port as a command line option --- command/agent/command.go | 1 + website/source/docs/agent/options.html.markdown | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/command/agent/command.go b/command/agent/command.go index c8dacec4e7..b7a99c02f6 100644 --- a/command/agent/command.go +++ b/command/agent/command.go @@ -91,6 +91,7 @@ func (c *Command) readConfig() *Config { cmdFlags.StringVar(&cmdConfig.ClientAddr, "client", "", "address to bind client listeners to (DNS, HTTP, HTTPS, RPC)") cmdFlags.StringVar(&cmdConfig.BindAddr, "bind", "", "address to bind server listeners to") cmdFlags.IntVar(&cmdConfig.Ports.HTTP, "http-port", 0, "http port to use") + cmdFlags.IntVar(&cmdConfig.Ports.DNS, "dns-port", 0, "DNS port to use") cmdFlags.StringVar(&cmdConfig.AdvertiseAddr, "advertise", "", "address to advertise instead of bind addr") cmdFlags.StringVar(&cmdConfig.AdvertiseAddrWan, "advertise-wan", "", "address to advertise on wan instead of bind or advertise addr") diff --git a/website/source/docs/agent/options.html.markdown b/website/source/docs/agent/options.html.markdown index 354c69c1db..b5852abdbd 100644 --- a/website/source/docs/agent/options.html.markdown +++ b/website/source/docs/agent/options.html.markdown @@ -141,6 +141,11 @@ The options below are all specified on the command-line. it relies on proper configuration. Nodes in the same datacenter should be on a single LAN. +* `-dns-port` - the DNS port to listen on. + This overrides the default port 8600. This option is very useful when deploying Consul + to an environment which communicates the DNS port through the environment e.g. PaaS like CloudFoundry, allowing + you to set the port directly via a Procfile. + * `-domain` - By default, Consul responds to DNS queries in the "consul." domain. This flag can be used to change that domain. All queries in this domain are assumed to be handled by Consul and will not be recursively resolved.