Skip to content
  • Solutions
    By Role
    • For Developers
    • For Content Managers
    • For Agencies
    • For IT Admins
    • For Web Hosters
    • For Developers
    • For Content Managers
    • For Agencies
    • For IT Admins
    • For Web Hosters
    By Infrastructure
    • Overview
    • AWS
    • Microsoft Azure
    • Alibaba Cloud
    • Google Cloud Platform
    • Vultr
    • Overview
    • AWS
    • Microsoft Azure
    • Alibaba Cloud
    • Google Cloud Platform
    • Vultr
    • Digital Ocean
    • Linode
    • Upcloud
    • Oracle
    • OVH
    • Digital Ocean
    • Linode
    • Upcloud
    • Oracle
    • OVH
  • Product
    • Plesk Features
    • Plesk Editions
    • What’s new
    • Pricing
    • Roadmap
    • Lifecycle Policy
    • Extensions Catalogue
  • Pricing
  • Extensions
    Featured Extensions
    • SocialBee
    • WP Toolkit
    • Sitejet Builder for Plesk
    • SEO Toolkit
    • Joomla! Toolkit
    • Premium Email
    • Email Security
    • SocialBee
    • WP Toolkit
    • Sitejet Builder for Plesk
    • SEO Toolkit
    • Joomla! Toolkit
    • Premium Email
    • Email Security
    Bundles and packs:
    • Business and Collaboration Edition
    • WP pack
    • Hosting pack
    • Power pack
    • Language pack
    • Business and Collaboration Edition
    • WP pack
    • Hosting pack
    • Power pack
    • Language pack

    See all Extensions

  • For Partners
    • Plesk Contributor Program
    • Plesk Partner Program
    • Affiliate program
    • Plesk University
  • Help Center
    • Documentation
    • Professional Services
    • Support
    • Contact Us
    • Wiki
    • Forum
  • Plesk 360 login
  • Free Trial
  • Pricing
  • Solutions
    • By Role
      • For Developers
      • For Content Managers
      • For Agencies
      • For IT Admins
      • For Web Hosters
    • By Infrastructure
      • Overview
      • Plesk on Amazon Web Services (AWS & Lightsail)
      • Microsoft Azure
      • Alibaba Cloud
      • Google Cloud Platform
      • Vultr
      • DigitalOcean
      • Linode
      • UpCloud
      • Oracle
      • OVH
  • Products
  • Pricing
  • Extensions
    • Featured Extensions
      • SocialBee
      • WP Toolkit
      • Sitejet Builder for Plesk
      • SEO Toolkit
      • Joomla! Toolkit
      • Premium Email
      • Email Security
    • Bundles and packs:
      • Business and Collaboration Edition
      • WP pack
      • Hosting pack
      • Power pack
      • Language pack
      • See all Extensions
  • For Partners
    • Plesk Contributor Program
    • Plesk Partner Program
    • Affiliate Program
    • Plesk University
  • Help Center
    • Documentation
    • Professional Services
    • Support
    • Contact Us
    • Wiki
    • Forum
  • Plesk 360 login
  • Free Trial
  • Pricing
  • Solutions
    • By Role
      • For Developers
      • For Content Managers
      • For Agencies
      • For IT Admins
      • For Web Hosters
    • By Infrastructure
      • Overview
      • Plesk on Amazon Web Services (AWS & Lightsail)
      • Microsoft Azure
      • Alibaba Cloud
      • Google Cloud Platform
      • Vultr
      • DigitalOcean
      • Linode
      • UpCloud
      • Oracle
      • OVH
  • Products
  • Pricing
  • Extensions
    • Featured Extensions
      • SocialBee
      • WP Toolkit
      • Sitejet Builder for Plesk
      • SEO Toolkit
      • Joomla! Toolkit
      • Premium Email
      • Email Security
    • Bundles and packs:
      • Business and Collaboration Edition
      • WP pack
      • Hosting pack
      • Power pack
      • Language pack
      • See all Extensions
  • For Partners
    • Plesk Contributor Program
    • Plesk Partner Program
    • Affiliate Program
    • Plesk University
  • Help Center
    • Documentation
    • Professional Services
    • Support
    • Contact Us
    • Wiki
    • Forum
  • Plesk 360 login
  • Free Trial
Plesk 360 login
Free Trial

Knowledge Base

How to get a list of customers, domains and their IP addresses from the Plesk database?

 
databasedomainsinterfaceiplinux

Question

How to get a list of customers, domains and their IP addresses from the Plesk database?

Answer

It is possible to retrieve corresponding information from the Plesk database via the command-line interface:

Plesk For Linux

  1. Connect to the server via SSH

  2. Run one of the following commands to retrieve the necessary information:

    • Get a list of domains and their IP addresses:

      # plesk db "SELECT d.id AS 'Domain ID', d.name AS 'Domain', ipc.ipAddressId AS 'IP ID', ip.ip_address AS 'IPv4/IPv6' FROM domains d, DomainServices ds, IpAddressesCollections ipc, IP_Addresses ip WHERE d.id = ds.dom_id AND ds.type = 'web' AND ds.ipCollectionId = ipc.ipCollectionId AND ip.id = ipc.ipAddressId ORDER BY d.id ASC"

      The output of the command will look as follows:

      +-----------+-----------------+-------+-----------------------+
      | Domain ID |          Domain | IP ID |             IPv4/IPv6 |
      +-----------+-----------------+-------+-----------------------+
      |         1 |     example.com |     1 |           203.0.113.2 |
      |         2 | sub.example.com |     1 |           203.0.113.2 |
      |         3 |     example.org |     1 |           203.0.113.2 |
      |         3 |     example.org |     2 | 2001:db8:f61:a1ff::80 |
      +-----------+-----------------+-------+-----------------------+

      If it's necessary to retrieve the content without box/table format, run this command instead:

      # plesk db -Ne "SELECT d.id, d.name, ipc.ipAddressId, ip.ip_address FROM domains d, DomainServices ds, IpAddressesCollections ipc, IP_Addresses ip WHERE d.id = ds.dom_id AND ds.type = 'web' AND ds.ipCollectionId = ipc.ipCollectionId AND ip.id = ipc.ipAddressId ORDER BY d.id ASC"

    • Get a list of customers, domains and their IP addresses:

      # plesk db "SELECT cl.id AS 'Client ID', cl.pname AS 'Name', cl.login AS 'Login', d.id AS 'Domain ID', d.name AS 'Domain', ipc.ipAddressId AS 'IP ID', ip.ip_address AS 'IPv4/IPv6' FROM clients cl, domains d, DomainServices ds, IpAddressesCollections ipc, IP_Addresses ip WHERE d.id = ds.dom_id AND d.cl_id = cl.id AND ds.type = 'web' AND ds.ipCollectionId = ipc.ipCollectionId AND ip.id = ipc.ipAddressId ORDER BY cl.id ASC"

      The output of the command will look as follows:

      +-----------+-------+-------+-----------+-----------------+-------+-----------------------+
      | Client ID |  Name | Login | Domain ID |          Domain | IP ID |             IPv4/IPv6 |
      +-----------+-------+-------+-----------+-----------------+-------+-----------------------+
      |         1 | Admin | admin |         1 |     example.com |     1 |           203.0.113.2 |
      |         1 | Admin | admin |         2 | sub.example.com |     1 |           203.0.113.2 |
      |         2 |  John |  jdoe |         3 |     example…

Tweet
Share
Share
Email
0 Shares
Read the full article
Related Posts

How to Check Open Ports in Linux (Simple Commands & Tools)

Read More »

Linux Logs Explained

Read More »

Exploring Plesk’s Added Value Solutions So Far in 2023

Read More »
Knowledge Base

 An operation fails in Plesk: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘X’ for key ‘PRIMARY’

Read More »

Cannot remove IP address from Plesk server: The IP address 203.0.113.2 is already used for hosting

Read More »

How to customize Plesk URL

Read More »

How to create an email account in Plesk

Read More »

Hosting Wiki

  • DBMS Interface
  • Server Redundancy
  • Linux Containers
  • Bare Metal Server
  • Oracle VM Server
  • Server Virtualization Software
  • Windows Server
  • Linux
  • JavaScript
  • Domain
  • Plesk
  • SQL database
  • NoSQL Database
  • Web Server
  • DNS Server
  • IPv6
  • IPv4
  • SIP
  • SSH
  • UDP/IP
  • TCP/IP
X-twitter Linkedin Youtube Reddit Github
  • Product
  • Login
  • Pricing
  • Editions
  • For Partners
  • Partner Program
  • Contributor Program
  • Affiliate Program
  • Plesk University
  • Company
  • Blog
  • Careers
  • Events
  • About Plesk
  • Our Brand
  • Resources
  • User and Admin guides
  • Help Center
  • Migrate to Plesk
  • Contact Us
  • Hosting Wiki
  • Forum
  • Legal
  • Legal
  • Privacy Policy
  • Imprint

© 2025 WebPros International GmbH

Part of the WebPros®  Family