mirror of
https://github.com/coredns/coredns.git
synced 2025-10-27 08:14:18 -04:00
Plugin/BIND - extend the syntax to allow multiple addresses (#1512)
* Extend bind to allow multiple addresses. UTs added. Changes the log for server starting, adding address when available * update readme for bind * fixes after review * minor fix on readme * accept multiple BIND directives in blocserver, consolidate the addresses * fixes after review - format logging server address, variable names
This commit is contained in:
committed by
Miek Gieben
parent
a0834b1dd5
commit
76455c6a0d
@@ -287,8 +287,22 @@ func (s *Server) OnStartupComplete() {
|
||||
return
|
||||
}
|
||||
|
||||
for zone, config := range s.zones {
|
||||
fmt.Println(zone + ":" + config.Port)
|
||||
for zone := range s.zones {
|
||||
// split addr into protocol, IP and Port
|
||||
_, ip, port, err := SplitProtocolHostPort(s.Addr)
|
||||
|
||||
if err != nil {
|
||||
// this should not happen, but we need to take care of it anyway
|
||||
fmt.Println(zone + ":" + s.Addr)
|
||||
return
|
||||
}
|
||||
if ip == "" {
|
||||
fmt.Println(zone + ":" + port)
|
||||
return
|
||||
}
|
||||
// if the server is listening on a specific address let's make it visible in the log,
|
||||
// so one can differentiate between all active listeners
|
||||
fmt.Println(zone + ":" + port + " on " + ip)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user