Article ID: 124159, created on Jan 7, 2015, last review on Jun 17, 2016

  • Applies to:
  • Plesk for Windows

For Linux version of KB see this article.

Symptoms

How to get list of domains and their IP addresses in one query?

Resolution

To get all domains and their IP addresses use Plesk dbclient.exe utility:

Run the query below:

>"%plesk_bin%\dbclient.exe" --direct-sql --sql="SELECT dom.id, dom.name, ia.ipAddressId, iad.ip_address FROM domains dom LEFT JOIN DomainServices d ON (dom.id = d.dom_id AND d.type = 'web') LEFT JOIN IpAddressesCollections ia ON ia.ipCollectionId = d.ipCollectionId LEFT JOIN IP_Addresses iad ON iad.id = ia.ipAddressId;"

You will get the result as below:

+----+-------------------------------+-------------+------------+
| id | name                          | ipAddressId | ip_address |
+----+-------------------------------+-------------+------------+
| 21 | domain1.tld                   |           2 | 10.0.0.1   |
| 36 | domain2.tld                   |           2 | 10.0.0.1   |
| 38 | domain3.tld                   |           2 | 10.0.0.1   |
| 26 | domain4.tld                   |           2 | 10.0.0.1   |
+------------------------------------+-------------+------------+

Search Words

get list of domains and their IP addresses

85a92ca67f2200d36506862eaa6ed6b8 56797cefb1efc9130f7c48a7d1db0f0c a914db3fdc7a53ddcfd1b2db8f5a1b9c

Email subscription for changes to this article
Save as PDF