You can add a domain as a parked/alias using the cPanel API whmapi1 in a single command line using the following syntax:
whmapi1 --output=json --user=USERNAME Park::addparkeddomain domain=DOMAINNAME
Replace USERNAME with your cPanel username and DOMAINNAME with the domain name you want to park/alias.
Here is an example command:
whmapi1 --output=json --user=myuser Park::addparkeddomain domain=example.net
This will add the domain example.net as a parked/alias domain for the cPanel account with the username myuser.
- How to change master domain for an account on cPanel server from command line
- How to update reseller’s subaccounts disk quota and bandwidth on cPanel server
- Cpanel whmapi1 tool notes
- How to create database, database username and grant all rights on cPanel server via command line using UAPI
- How to deal with “ea-php72” is not an EA4 SCL PHP error