From 147a5046aadc2909647be32194c65d67eb42d9ce Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 29 Sep 2020 17:28:31 +0200 Subject: [PATCH] resolvectl: show resolv.conf mode in resolvectl output --- src/resolve/resolvectl.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/resolve/resolvectl.c b/src/resolve/resolvectl.c index 8378ff591c7..4581c2e3c87 100644 --- a/src/resolve/resolvectl.c +++ b/src/resolve/resolvectl.c @@ -1662,6 +1662,7 @@ struct global_info { const char *mdns; const char *dns_over_tls; const char *dnssec; + const char *resolv_conf_mode; bool dnssec_supported; }; @@ -1691,6 +1692,7 @@ static int status_global(sd_bus *bus, StatusMode mode, bool *empty_line) { { "DNSOverTLS", "s", NULL, offsetof(struct global_info, dns_over_tls) }, { "DNSSEC", "s", NULL, offsetof(struct global_info, dnssec) }, { "DNSSECSupported", "b", NULL, offsetof(struct global_info, dnssec_supported) }, + { "ResolvConfMode", "s", NULL, offsetof(struct global_info, resolv_conf_mode) }, {} }; _cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL; @@ -1775,6 +1777,14 @@ static int status_global(sd_bus *bus, StatusMode mode, bool *empty_line) { if (r < 0) return table_log_add_error(r); + if (global_info.resolv_conf_mode) { + r = table_add_many(table, + TABLE_STRING, "resolv.conf mode:", + TABLE_STRING, global_info.resolv_conf_mode); + if (r < 0) + return table_log_add_error(r); + } + if (global_info.current_dns) { r = table_add_many(table, TABLE_STRING, "Current DNS Server:", -- 2.47.3