coredns/middleware/bind/setup.go
Yong Tang 81af74aad0 Fix import path github.com/miekg/coredns -> github.com/coredns/coredns (#547)
This fix fixes import path from
`github.com/miekg/coredns`
->
`github.com/coredns/coredns`
2017-02-22 06:51:47 +00:00

24 lines
493 B
Go

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
}