coredns/plugin/bind
Chris O'Haver 5c07ab7b78
doc bind collision issue (#4394)
Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
2021-01-15 17:26:34 +01:00
..
bind.go plugin register (#3321) 2019-09-28 10:40:43 +01:00
log_test.go Clean up tests logging (#1979) 2018-07-19 16:23:06 +01:00
README.md doc bind collision issue (#4394) 2021-01-15 17:26:34 +01:00
setup.go For caddy v1 in our org (#4018) 2020-09-24 18:14:41 +02:00
setup_test.go For caddy v1 in our org (#4018) 2020-09-24 18:14:41 +02:00

bind

Name

bind - overrides the host to which the server should bind.

Description

Normally, the listener binds to the wildcard host. However, you may want the listener to bind to another IP instead.

If several addresses are provided, a listener will be open on each of the IP provided.

Each address has to be an IP of one of the interfaces of the host.

Syntax

bind ADDRESS  ...

ADDRESS is an IP address to bind to. When several addresses are provided a listener will be opened on each of the addresses.

Examples

To make your socket accessible only to that machine, bind to IP 127.0.0.1 (localhost):

. {
    bind 127.0.0.1
}

To allow processing DNS requests only local host on both IPv4 and IPv6 stacks, use the syntax:

. {
    bind 127.0.0.1 ::1
}

If the configuration comes up with several bind plugins, all addresses are consolidated together: The following sample is equivalent to the preceding:

. {
    bind 127.0.0.1
    bind ::1
}

Bugs

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 without the bind plugin, a server will bind to all interfaces, and this will collide with another server if it's using bind 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 a.bad.example.com:

a.bad.example.com {
    bind 127.0.0.1
    forward . 1.2.3.4
}

bad.example.com {
    forward . 5.6.7.8
}