Yeah, it’s possible to sort out all associated domains (Subdomains, 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.

How to change main domain of a cPanel reseller account with an existing domain name?

Hey!! Here are some tips on cPanel reseller account modification.

It’s quite simple if the new domain you wish to set as primary of your WHM re-seller is not under the same account. It can be simply managed from the “Modify an Account” section. You can simply modify the account information from this location. As it is a re-seller, you must do the following steps after modifying the account.

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