In cPanel by default any addon domain or subdomain will share the IP of the main domain account. But if you wanted a dedicated IP, This can be done through following steps:
First SSH into the server and edit the below file:
nano -w /var/cpanel/userdata/user/domain.com
In this file we can modify the IP of the subdomain or addon domain.
The content of the file will look like as:
documentroot: /home/user/public_html/sub1 group: user hascgi: 1 homedir: /home/user ip: 127.0.0.1 no_cache_update: 0 phpopenbasedirprotect: 1 serveradmin: [email protected] serveralias: www.sub1.domain.com servername: sub1.domain.com usecanonicalname: 'Off' user: user userdirprotect: ''
Now change the IP to the new IP address.
Rebuild and Restart Apache:
Now we are all set to use the new IP.