]>
git.ipfire.org Git - thirdparty/systemd.git/commit
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.