Skip to content

Commit f686d34

Browse files
authored
Merge pull request #2263 from sweeneyb/dnsPort
Add support for dns port as a command line option
2 parents 4b2eaed + 14ec329 commit f686d34

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

command/agent/command.go

+1
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ func (c *Command) readConfig() *Config {
9191
cmdFlags.StringVar(&cmdConfig.ClientAddr, "client", "", "address to bind client listeners to (DNS, HTTP, HTTPS, RPC)")
9292
cmdFlags.StringVar(&cmdConfig.BindAddr, "bind", "", "address to bind server listeners to")
9393
cmdFlags.IntVar(&cmdConfig.Ports.HTTP, "http-port", 0, "http port to use")
94+
cmdFlags.IntVar(&cmdConfig.Ports.DNS, "dns-port", 0, "DNS port to use")
9495
cmdFlags.StringVar(&cmdConfig.AdvertiseAddr, "advertise", "", "address to advertise instead of bind addr")
9596
cmdFlags.StringVar(&cmdConfig.AdvertiseAddrWan, "advertise-wan", "", "address to advertise on wan instead of bind or advertise addr")
9697

website/source/docs/agent/options.html.markdown

+5
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,11 @@ The options below are all specified on the command-line.
141141
it relies on proper configuration. Nodes in the same datacenter should be on a single
142142
LAN.
143143

144+
* <a name="_dns_port"></a><a href="#_dns_port">`-dns-port`</a> - the DNS port to listen on.
145+
This overrides the default port 8600. This option is very useful when deploying Consul
146+
to an environment which communicates the DNS port through the environment e.g. PaaS like CloudFoundry, allowing
147+
you to set the port directly via a Procfile.
148+
144149
* <a name="_domain"></a><a href="#_domain">`-domain`</a> - By default, Consul responds to DNS queries
145150
in the "consul." domain. This flag can be used to change that domain. All queries in this domain
146151
are assumed to be handled by Consul and will not be recursively resolved.

0 commit comments

Comments
 (0)