• The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Question List of domains under a subscription

Dave W

Regular Pleskian
Hello all,

Is there a way to get a list of domains hosted on a subscription from the plesk db on CLI?

We have to move alot of subscriptions and need to implement this "workaround" for all the domains that will be moved.

Regards
Dave
 
It depends on what you have to start with. For example, if you know the subscription name and want to get a list of the domains of that subscription, you could run an SQL query on the psa database like

Code:
select a.name AS domainname
FROM domains AS a
inner join hosting  AS b ON b.dom_id = a.id
inner join sys_users AS c ON c.id = b.sys_user_id
where c.login LIKE '<name of subscription>'

This will include all subdomains of the subscription, too.
To run the query, either enter the "plesk db" database interface or run it directly as a command from the console:

Code:
# plesk db "select a.name AS domainname FROM domains AS a inner join hosting  AS b ON b.dom_id = a.id inner join sys_users AS c ON c.id = b.sys_user_id where c.login LIKE '<name of subscription>'"

Replace "<name of subscription>" with the subscription's name.
 
Hey Peter,

Almost there :)

Code:
 plesk db "select a.name AS domainname FROM domains AS a inner join hosting  AS b ON b.dom_id = a.id inner join sys_users AS c ON c.id = b.sys_user_id where c.home LIKE '%<subscription name%'"
 
Just been poking about with this;

The code above wont list domains that have no hosting, just DNS hosting.
 
Last edited:
Back
Top