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.

root@server10 []# 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

Arunlal Ashok

Linux Server Administrator. I’m managing Linux servers since 2012. I started this blog to share and discuss my ideas.

Any questions? Write to arun (@)

You may also like...

2 Responses

  1. Asma Shahzadi says:

    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 *