Update /status to return currently set upstream DNS servers.

This commit is contained in:
Eugene Bujak 2018-09-25 19:53:15 +03:00
parent da62fac76e
commit a65a40c6be
2 changed files with 11 additions and 0 deletions

View File

@ -193,6 +193,7 @@ func handleStatus(w http.ResponseWriter, r *http.Request) {
"dns_address": config.BindHost, "dns_address": config.BindHost,
"dns_port": config.CoreDNS.Port, "dns_port": config.CoreDNS.Port,
"querylog_enabled": config.CoreDNS.QueryLogEnabled, "querylog_enabled": config.CoreDNS.QueryLogEnabled,
"upstream_dns": config.CoreDNS.UpstreamDNS,
} }
json, err := json.Marshal(data) json, err := json.Marshal(data)

View File

@ -61,6 +61,16 @@ paths:
responses: responses:
200: 200:
description: OK description: OK
examples:
application/json:
dns_address: 127.0.0.1
dns_port: 53
querylog_enabled: true
running: true
upstream_dns:
- 1.1.1.1
- 1.0.0.1
version: "v0.1"
/querylog: /querylog:
get: get:
tags: tags: