From a65a40c6beb00176f46e7187ba0c4b678b17f6d8 Mon Sep 17 00:00:00 2001
From: Eugene Bujak <hmage@hmage.net>
Date: Tue, 25 Sep 2018 19:53:15 +0300
Subject: [PATCH] Update /status to return currently set upstream DNS servers.

---
 control.go   |  1 +
 openapi.yaml | 10 ++++++++++
 2 files changed, 11 insertions(+)

diff --git a/control.go b/control.go
index 340f8479..a8bb391b 100644
--- a/control.go
+++ b/control.go
@@ -193,6 +193,7 @@ func handleStatus(w http.ResponseWriter, r *http.Request) {
 		"dns_address":      config.BindHost,
 		"dns_port":         config.CoreDNS.Port,
 		"querylog_enabled": config.CoreDNS.QueryLogEnabled,
+		"upstream_dns":     config.CoreDNS.UpstreamDNS,
 	}
 
 	json, err := json.Marshal(data)
diff --git a/openapi.yaml b/openapi.yaml
index 5c458978..e39fc090 100644
--- a/openapi.yaml
+++ b/openapi.yaml
@@ -61,6 +61,16 @@ paths:
             responses:
                 200:
                     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:
         get:
             tags: