From: Zbigniew Jędrzejewski-Szmek Date: Thu, 6 Nov 2025 14:34:10 +0000 (+0100) Subject: resolvectl: add --json support for status commands (#38960) X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ca5fa2f5ad39d78f9e563be687097fa271bdce1b;p=thirdparty%2Fsystemd.git resolvectl: add --json support for status commands (#38960) Add --json support for all status commands in resolvectl by making use of the new DumpDNSConfiguration varlink method. E.g, ``` $ resolvectl --json=pretty status eth0 [ { "ifname" : "eth0", "ifindex" : 9, "defaultRoute" : true, "currentServer" : { "addressString" : "10.148.181.1", "address" : [ 10, 148, 181, 1 ], "family" : 2, "port" : 53, "ifindex" : 9, "accessible" : true }, "servers" : [ { "addressString" : "10.148.181.1", "address" : [ 10, 148, 181, 1 ], "family" : 2, "port" : 53, "ifindex" : 9, "accessible" : true } ], "searchDomains" : [ { "name" : "local", "routeOnly" : false, "ifindex" : 9 } ], "dnssec" : "allow-downgrade", "dnsOverTLS" : "no", "llmnr" : "no", "mDNS" : "no", "scopes" : [ { "protocol" : "dns", "ifindex" : 9, "ifname" : "eth0", "dnssec" : "allow-downgrade", "dnsOverTLS" : "no" } ] } ] ``` Like the regular status output, fields are omitted all together when empty, unless explicitly requested via one of the sub-commands dns, domain, nta, etc. Closes https://github.com/systemd/systemd/issues/33036. --- ca5fa2f5ad39d78f9e563be687097fa271bdce1b