blob: 1e7178cc3f915099ae353c71d7adb19ff422ee79 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
package bind
import (
"fmt"
"net"
"github.com/coredns/coredns/core/dnsserver"
"github.com/coredns/coredns/middleware"
"github.com/mholt/caddy"
)
func setupBind(c *caddy.Controller) error {
config := dnsserver.GetConfig(c)
for c.Next() {
if !c.Args(&config.ListenHost) {
return middleware.Error("bind", c.ArgErr())
}
}
if net.ParseIP(config.ListenHost) == nil {
return middleware.Error("bind", fmt.Errorf("not a valid IP address: %s", config.ListenHost))
}
return nil
}
|