How to list all the subservers of a parent domain with virtualmin on CLI?

We already have non-virtualmin solution to this problem - by iterating all the servers within domains - but I thought maybe there is a simpler way. Unfortunately, none of the below commands listed the sub-servers:

virtualmin list-domains --domain parent.tld --subdomain
virtualmin list-domains --domain parent.tld --subserver
virtualmin list-domains --domain parent.tld --parent
virtualmin list-domains --domain parent.tld --toplevel

and generally it is not clear how to use each of them. Documentation pages have no use case examples, unfortunately.

If there is no way to get all the sub-servers with given parent domain, would you consider introducing new feature to virtualmin CLI for this?

Status: 
Closed (works as designed)

Comments

Joe's picture
Submitted by Joe on Fri, 08/18/2017 - 06:25 Pro Licensee

I believe this does what you want:

# virtualmin list-domains --parent parent.tld

Holler if that's not what you're after.

It does look like we need more examples in the docs for the CLI. I've added it to my todo list for the docs overhaul that's coming as soon as I get the bugs in the new installer wrapped up.

That's exactly needed command, thanks! But I believe it is confusing - when you put argument --parent you imagine it will list parents of a given domain name and not its children.

Anyway, it is what it is. But then is there any way to quickly know the parent of a given sub-domain name? In the other thread we discussed non-virtualmin of deriving the parent domain. But maybe there is a Virtualmin command to do so?

You can get the parent domain (and a bunch of other information) by running virtualmin list-domains --domain example.com --multiline)

Status: Active ยป Closed (works as designed)

Fair enough. We know how to use variables in multiline mode.