Include DNS server config in status
This commit is contained in:
1 parent
6f57774d15
commit
c36543a247
4 files changed
+18
-9
No files matched your search
@@ -6,6 +6,7 @@ import (
|
||||
. "github.com/zettio/weave/common"
|
||||
"net"
|
||||
"sync"
|
||||
"bytes"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -142,6 +143,17 @@ func (s *DNSServer) Start() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Return status string
|
||||
func (s *DNSServer) Status() string {
|
||||
var buf bytes.Buffer
|
||||
buf.WriteString(fmt.Sprintln("Local domain", s.Domain))
|
||||
buf.WriteString(fmt.Sprintln("Listen address", s.ListenAddr))
|
||||
buf.WriteString(fmt.Sprintln("mDNS interface", s.iface))
|
||||
buf.WriteString(fmt.Sprintln("Fallback DNS config", s.upstream))
|
||||
buf.WriteString(fmt.Sprintf("Zone database:\n%s", s.zone))
|
||||
return buf.String()
|
||||
}
|
||||
|
||||
// Perform a graceful shutdown
|
||||
func (s *DNSServer) Stop() error {
|
||||
if err := s.tcpSrv.Shutdown(); err != nil {
|
||||
|
||||
Reference in new issue
Block a user