Skip to content

Commit

Permalink
Add -p for port flag (coredns#4653)
Browse files Browse the repository at this point in the history
-p is the default flag in DNS software for setting the port, we use
'dns.port' because of preventing clashes with other caddy software
users. This is no longer an issue, so we can do what we want here.

Add -p to works like -dns.port.

(this PR includes generated manpage, but that shouldn't matter too much)

Signed-off-by: Miek Gieben <[email protected]>
  • Loading branch information
miekg authored May 28, 2021
1 parent 053c4d5 commit bcbe624
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions core/dnsserver/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const serverType = "dns"
// wise they potentially clash with other server types.
func init() {
flag.StringVar(&Port, serverType+".port", DefaultPort, "Default port")
flag.StringVar(&Port, "p", DefaultPort, "Default port")

caddy.RegisterServerType(serverType, caddy.ServerType{
Directives: func() []string { return Directives },
Expand Down
2 changes: 1 addition & 1 deletion coredns.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Available options:
: specify Corefile to load, if not given CoreDNS will look for a `Corefile` in the current
directory.

**-dns.port** **PORT**
**-dns.port** **PORT** or **-p** **PORT**
: override default port (53) to listen on.

**-pidfile** **FILE**
Expand Down
6 changes: 3 additions & 3 deletions man/coredns.1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.\" Generated by Mmark Markdown Processer - mmark.miek.nl
.TH "COREDNS" 1 "March 2021" "CoreDNS" "CoreDNS"
.TH "COREDNS" 1 "May 2021" "CoreDNS" "CoreDNS"

.SH "COREDNS"
.PP
Expand Down Expand Up @@ -32,7 +32,7 @@ Available options:
specify Corefile to load, if not given CoreDNS will look for a \fB\fCCorefile\fR in the current
directory.
.TP
\fB-dns.port\fP \fBPORT\fP
\fB-dns.port\fP \fBPORT\fP or \fB-p\fP \fBPORT\fP
override default port (53) to listen on.
.TP
\fB-pidfile\fP \fBFILE\fP
Expand All @@ -58,5 +58,5 @@ Apache License 2.0

.SH "SEE ALSO"
.PP
Corefile(5) coredns-k8s_external(7) coredns-any(7) coredns-hosts(7) coredns-reload(7) coredns-acl(7) coredns-dnssec(7) coredns-health(7) coredns-grpc(7) coredns-sign(7) coredns-log(7) coredns-tls(7) coredns-file(7) coredns-root(7) coredns-loop(7) coredns-chaos(7) coredns-dnstap(7) coredns-pprof(7) coredns-bufsize(7) coredns-clouddns(7) coredns-loadbalance(7) coredns-cache(7) coredns-whoami(7) coredns-minimal(7) coredns-bind(7) coredns-erratic(7) coredns-auto(7) coredns-import(7) coredns-debug(7) coredns-template(7) coredns-azure(7) coredns-autopath(7) coredns-kubernetes(7) coredns-forward(7) coredns-nsid(7) coredns-secondary(7) coredns-route53(7) coredns-local(7) coredns-errors(7) coredns-transfer(7) coredns-ready(7) coredns-metadata(7) coredns-rewrite(7) coredns-metrics(7) coredns-dns64(7) coredns-etcd(7) coredns-cancel(7) coredns-trace(7).
Corefile(5) coredns-k8s_external(7) coredns-any(7) coredns-hosts(7) coredns-acl(7) coredns-dnssec(7) coredns-health(7) coredns-grpc(7) coredns-sign(7) coredns-log(7) coredns-tls(7) coredns-file(7) coredns-root(7) coredns-loop(7) coredns-chaos(7) coredns-dnstap(7) coredns-pprof(7) coredns-bufsize(7) coredns-clouddns(7) coredns-loadbalance(7) coredns-cache(7) coredns-whoami(7) coredns-minimal(7) coredns-dns64(7) coredns-erratic(7) coredns-auto(7) coredns-import(7) coredns-debug(7) coredns-template(7) coredns-azure(7) coredns-autopath(7) coredns-kubernetes(7) coredns-forward(7) coredns-nsid(7) coredns-secondary(7) coredns-route53(7) coredns-local(7) coredns-bind(7) coredns-errors(7) coredns-transfer(7) coredns-ready(7) coredns-reload(7) coredns-rewrite(7) coredns-metrics(7) coredns-metadata(7) coredns-etcd(7) coredns-cancel(7) coredns-trace(7).

0 comments on commit bcbe624

Please sign in to comment.