Merge pull request #1662 from weaveworks/issues/1571-upstream-dns-report
DNS upstream servers report
This commit is contained in:
commit
8a4f038ec4
3 files changed
+15
-4
No files matched your search
@@ -1,10 +1,11 @@
|
||||
package nameserver
|
||||
|
||||
type Status struct {
|
||||
Domain string
|
||||
Address string
|
||||
TTL uint32
|
||||
Entries []EntryStatus
|
||||
Domain string
|
||||
Upstream []string
|
||||
Address string
|
||||
TTL uint32
|
||||
Entries []EntryStatus
|
||||
}
|
||||
|
||||
type EntryStatus struct {
|
||||
@@ -37,6 +38,7 @@ func NewStatus(ns *Nameserver, dnsServer *DNSServer) *Status {
|
||||
|
||||
return &Status{
|
||||
dnsServer.domain,
|
||||
dnsServer.upstream.Servers,
|
||||
dnsServer.address,
|
||||
dnsServer.ttl,
|
||||
entryStatusSlice}
|
||||
|
||||
@@ -25,6 +25,12 @@ var rootTemplate = template.New("root").Funcs(map[string]interface{}{
|
||||
}
|
||||
return count
|
||||
},
|
||||
"upstreamServers": func(servers []string) string {
|
||||
if len(servers) == 0 {
|
||||
return "none"
|
||||
}
|
||||
return strings.Join(servers, ", ")
|
||||
},
|
||||
"printConnectionCounts": func(conns []mesh.LocalConnectionStatus) string {
|
||||
counts := make(map[string]int)
|
||||
for _, conn := range conns {
|
||||
@@ -108,6 +114,7 @@ var statusTemplate = defTemplate("status", `\
|
||||
|
||||
Service: dns
|
||||
Domain: {{.DNS.Domain}}
|
||||
Upstream: {{upstreamServers .DNS.Upstream}}
|
||||
TTL: {{.DNS.TTL}}
|
||||
Entries: {{countDNSEntries .DNS.Entries}}
|
||||
{{end}}\
|
||||
|
||||
@@ -260,6 +260,7 @@ DNS:
|
||||
|
||||
Service: dns
|
||||
Domain: weave.local.
|
||||
Upstream: 8.8.8.8, 8.8.4.4
|
||||
TTL: 1
|
||||
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 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 total number of entries
|
||||
|
||||
|
||||
Reference in new issue
Block a user