diff --git a/nameserver/status.go b/nameserver/status.go index 6124f08d..2a280c57 100644 --- a/nameserver/status.go +++ b/nameserver/status.go @@ -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} diff --git a/prog/weaver/http.go b/prog/weaver/http.go index cb828f47..6794967e 100644 --- a/prog/weaver/http.go +++ b/prog/weaver/http.go @@ -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}}\