Merge pull request #1662 from weaveworks/issues/1571-upstream-dns-report

DNS upstream servers report
This commit is contained in:
Adam Harrison committed 2015-11-25 16:47:14 +00:00
commit 8a4f038ec4
3 files changed
+15 -4

No files matched your search

+6 -4
View File
@@ -1,10 +1,11 @@
package nameserver package nameserver
type Status struct { type Status struct {
Domain string Domain string
Address string Upstream []string
TTL uint32 Address string
Entries []EntryStatus TTL uint32
Entries []EntryStatus
} }
type EntryStatus struct { type EntryStatus struct {
@@ -37,6 +38,7 @@ func NewStatus(ns *Nameserver, dnsServer *DNSServer) *Status {
return &Status{ return &Status{
dnsServer.domain, dnsServer.domain,
dnsServer.upstream.Servers,
dnsServer.address, dnsServer.address,
dnsServer.ttl, dnsServer.ttl,
entryStatusSlice} entryStatusSlice}
+7
View File
@@ -25,6 +25,12 @@ var rootTemplate = template.New("root").Funcs(map[string]interface{}{
} }
return count return count
}, },
"upstreamServers": func(servers []string) string {
if len(servers) == 0 {
return "none"
}
return strings.Join(servers, ", ")
},
"printConnectionCounts": func(conns []mesh.LocalConnectionStatus) string { "printConnectionCounts": func(conns []mesh.LocalConnectionStatus) string {
counts := make(map[string]int) counts := make(map[string]int)
for _, conn := range conns { for _, conn := range conns {
@@ -108,6 +114,7 @@ var statusTemplate = defTemplate("status", `\
Service: dns Service: dns
Domain: {{.DNS.Domain}} Domain: {{.DNS.Domain}}
Upstream: {{upstreamServers .DNS.Upstream}}
TTL: {{.DNS.TTL}} TTL: {{.DNS.TTL}}
Entries: {{countDNSEntries .DNS.Entries}} Entries: {{countDNSEntries .DNS.Entries}}
{{end}}\ {{end}}\
+2
View File
@@ -260,6 +260,7 @@ DNS:
Service: dns Service: dns
Domain: weave.local. Domain: weave.local.
Upstream: 8.8.8.8, 8.8.4.4
TTL: 1 TTL: 1
Entries: 9 Entries: 9
@@ -272,6 +273,7 @@ guide](troubleshooting.html#weave-status) for more detail.
The 'Service: dns' section is pertinent to weaveDNS, and includes: The 'Service: dns' section is pertinent to weaveDNS, and includes:
* The local domain suffix which is being served * The local domain suffix which is being served
* The list of upstream servers used for resolving names not in the local domain
* The response ttl * The response ttl
* The total number of entries * The total number of entries