Is there any option to list Subdomains, Addon domains and Parked domains of a cPanel account via command line?

Yeah, it’s possible to sort out all associated domains (Sub-domains, Addon-domains and Parked-domains) for a cPanel account via command line. This will be helpful for server admins to sort out all associated accounts simply and quickly from the command line. In a cPanel server, there is a file “main” in “/var/cpanel/userdata/$username” (where $username is the actual username) which stores all accounts details associated with it. From there you can see all the domain associated with that particular cPanel account.

Please see the sample output pasted below:

1, Log into server as root.
2, View the file as I mentioned.

[email protected] []# cat /var/cpanel/userdata/test123/main
addon_domains: {}

cp_php_magic_include_path.conf: 0


parked_domains: []


Where is the domain name and test123 is the username.

You can also list this from the WHM.

1, Log into WHM panel.
2, Under “Account Information” tab,

>> List Parked Domains – To list all parked domains with original domain details.
>> List Subdomains – To list Subdomains, Addon Domains and Parked Domains.


If you have only the cPanel access, then follow these steps to list them:

1, Log into cPanel.
2, Uder “Domains” tab you will get all associated accounts.

>> Subdomains
>> Addon Domains
>> Parked Domains

That’s it!!

Related posts:
1, How to change main domain of a cPanel reseller account with an existing domain name?
2, The XCache – Simple way to install Xcache from source code
3, How to check cPanel rpm works or not – cPanel script to check rpm
4, Simple steps to install CloudFlare plugin on cPanel server

Post navigation

Arunlal Ashok

Linux Systems Architect at Endurance International Group. I know her (Linux) since many years. Linux lover. Like to play on Linux console. I started this blog to share and discuss Linux thoughts.

Always happy for an open discussion! Write to arun (@) crybit (dot) com. Check about me for more details. About this blog and our strong members, check The team

2 thoughts on “Is there any option to list Subdomains, Addon domains and Parked domains of a cPanel account via command line?

  1. Wonderful informative stuff thanks for sharing. I don’t need that, but good to have some knowledge about it.

Leave a Reply

Your email address will not be published. Required fields are marked *