coredns/man/coredns-bind.7
coredns-auto-go-mod-tidy[bot] 94e027cd6f auto make -f Makefile.doc
2021-03-08 11:15:45 +00:00

102 lines
1.9 KiB
Groff

.\" Generated by Mmark Markdown Processer - mmark.miek.nl
.TH "COREDNS-BIND" 7 "March 2021" "CoreDNS" "CoreDNS Plugins"
.SH "NAME"
.PP
\fIbind\fP - overrides the host to which the server should bind.
.SH "DESCRIPTION"
.PP
Normally, the listener binds to the wildcard host. However, you may want the listener to bind to
another IP instead.
.PP
If several addresses are provided, a listener will be open on each of the IP provided.
.PP
Each address has to be an IP of one of the interfaces of the host.
.SH "SYNTAX"
.PP
.RS
.nf
bind ADDRESS ...
.fi
.RE
.PP
\fBADDRESS\fP is an IP address to bind to.
When several addresses are provided a listener will be opened on each of the addresses.
.SH "EXAMPLES"
.PP
To make your socket accessible only to that machine, bind to IP 127.0.0.1 (localhost):
.PP
.RS
.nf
\&. {
bind 127.0.0.1
}
.fi
.RE
.PP
To allow processing DNS requests only local host on both IPv4 and IPv6 stacks, use the syntax:
.PP
.RS
.nf
\&. {
bind 127.0.0.1 ::1
}
.fi
.RE
.PP
If the configuration comes up with several \fIbind\fP plugins, all addresses are consolidated together:
The following sample is equivalent to the preceding:
.PP
.RS
.nf
\&. {
bind 127.0.0.1
bind ::1
}
.fi
.RE
.SH "BUGS"
.PP
When defining more than one server block, take care not to bind more than one server to the same
address and port. Doing so will result in unpredictable behavior (requests may be randomly
served by either server). Keep in mind that \fIwithout\fP the \fIbind\fP plugin, a server will bind to all
interfaces, and this will collide with another server if it's using \fIbind\fP to listen to an interface
on the same port. For example, the following creates two servers that both listen on 127.0.0.1:53,
which would result in unpredictable behavior for queries in \fB\fCa.bad.example.com\fR:
.PP
.RS
.nf
a.bad.example.com {
bind 127.0.0.1
forward . 1.2.3.4
}
bad.example.com {
forward . 5.6.7.8
}
.fi
.RE