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

Domain

 
extensions guideplesk features available for extensionsretrieve data from pleskdatabasedomain name

To retrieve information about a domain, use the
pm_Domain
class.

The
pm_Domain
class represents a domain hosted in Plesk. This class supports
retrieving information about a domain by its ID.

Retrieving domain information

To retrieve the various data about a domain, use these methods:

  • getName()
    - returns the domain name.
  • getProperty()
    - returns various properties from the domains table in the Plesk
    database.
  • getGuid()
    - returns the domain GUID.
  • getDisplayName()
    - returns the domain display name.
  • getIpAddresses()
    - returns the domain IP addresses (IPv4 or IPv6 or both). By default,
    public IP addresses are returned. If the $public argument is set to
    “false”, the external IP addresses are returned instead.
  • isActive()
    - returns “true” if the domain is active, “false” otherwise.
  • isSuspended()
    - returns “true” if the domain is suspended, “false” otherwise.
  • isDisabled()
    - returns “true” if the domain is disabled, “false” otherwise.
  • hasHosting()
    - returns “true” if the domain has web hosing type; “false”
    otherwise.
  • getHomePath()
    - returns the webspace home path.
  • getSysUserLogin()
    - returns login of the webspace system user.
  • getDocumentRoot()
    - returns the domain document root directory. Available only for
    domains with web hosting. By default, an absolute path is returned.
    If the $relative argument is set to “true”, the root directory
    relative to the home path is returned.
  • getVhostSystemPath()
    - returns the domain vhost system directory. Available only for
    domains with web hosting.

Also, there following static methods can be used for retrieving domains:

  • getByDomainId()
    - retrieves the domain by domain id.
  • getByGuid()
    - retrieves the domain by domain GUID.
  • getByName()
    - retrieves the domain by domain display name.
  • getAllDomains()
    - retrieves all domains, including additional domains and subdomains.
    If the $mainDomainsOnly argument is set to “true”, only main
    domains are returned.
  • getDomainsByClient()
    - retrieves all domains, including additional domains and subdomains
    owned by $client. If the $mainDomainsOnly argument is set to
    “true”, only main domains are returned.

You can also use the
pm_View_Helper_DomainOverviewUrl
class to help you build the URL to the Domain Overview page.

Storing and Retrieving Domain-specific Data

It is possible to store and retrieve arbitrary data for a specific
domain. The following methods add new data records, retrieve existing
data and remove records that are no longer needed:

  • getSetting()
  • setSetting()
  • deleteSettings()

Note: These serve as a key-value storage for a specific
domain.

Examples

To retrieve the name and creation date of a domain, use the following
code:

$domain = new pm_Domain($domainId);
echo "Domain name: {$domain->getName()}";
echo "Created at {$domain->getProperty('cr_date')}";
Tweet
Share
Share
Email
0 Shares
Read the full article
Related Posts

Plesk with Centralized Database and Network File System

Read More »

6 Things to Keep in Mind When Choosing an Ideal Server for Big Data Requirements

Read More »

Configuring DNS For A Domain With Plesk

Read More »
Knowledge Base

Managing Web Hosting – Adding Domain Aliases

Read More »

Managing Web Hosting – Setting MIME Types

Read More »

Managing Web Hosting – Configuring PHP Settings

Read More »

Managing Web Hosting – Setting the Default Homepage

Read More »

Hosting Wiki

  • JavaScript
  • Subdomain
  • Domain
  • Hosting Control Panel
  • Plesk
  • SQL database
  • NoSQL Database
  • IPv6
  • IPv4
  • SIP
  • UDP/IP
  • URL
  • Colocation Hosting
  • Reseller Hosting
  • Cloud Hosting
  • VPS Hosting
  • Dedicated Hosting
  • Shared Hosting
  • Free Hosting
  • Managed Hosting
  • 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