diff --git a/nameserver/http.go b/nameserver/http.go index 83fbbf0e..5e3e7181 100644 --- a/nameserver/http.go +++ b/nameserver/http.go @@ -17,12 +17,13 @@ func httpErrorAndLog(level *log.Logger, w http.ResponseWriter, msg string, level.Printf("[http] "+logmsg, logargs...) } -func ListenHttp(domain string, db Zone, port int) { +func ListenHttp(version string, domain string, db Zone, port int) { router := mux.NewRouter() router.Methods("GET").Path("/status").HandlerFunc(func(w http.ResponseWriter, r *http.Request) { - io.WriteString(w, "ok") + io.WriteString(w, fmt.Sprintln("weave DNS", version)) + io.WriteString(w, fmt.Sprintln("Serving domain", domain)) }) router.Methods("PUT").Path("/name/{identifier:.+}/{ip:.+}").HandlerFunc(func(w http.ResponseWriter, r *http.Request) { diff --git a/weavedns/main.go b/weavedns/main.go index 46560467..9e1fd2fb 100644 --- a/weavedns/main.go +++ b/weavedns/main.go @@ -83,7 +83,7 @@ func main() { Debug.Printf("DNS fallback at %s:%s", fallbackHost, fallbackPort) } - go weavedns.ListenHttp(localDomain, zone, httpPort) + go weavedns.ListenHttp(version, localDomain, zone, httpPort) srv, err := weavedns.NewDNSServer(srvConfig, zone, iface) if err != nil { Error.Fatal("Failed to initialize the WeaveDNS server", err)