WHM & cPanel's GUI only allows for one IP address to be assigned per cPanel account, however it is possible to assign sub-domains of a cPanel account their own IP addresses but for some reason this feature has not been built into the UI for general use. The only way to do this in fact is through SSH, so if you are looking to do this yourself then please bare in mind this is for advanced users only and following this guide is at your own risk!
- You will need to load up SSH and login to your server, once in you need to locate the file on the server for the sub-domain you wish to modify, the path is: /var/cpanel/userdata/$cpaneluser/$subdomain.$maindomain.$tld, replace each of the $ sections with the relevant data. TIP: if your unsure use the ls command to view whats in each folder.
- Edit the file in your favorite editor, I use NANO. Locate the IP section and change this to the IP you need for this domain, then save the file and close your editor.
- In the same location there will be a file with exactly the same name but with .cache as the extension, use RM to remove this file from the server.
- Now run the following command: /scripts/rebuildhttpdconf
- Edit the DNS zone for the sub-domain (which will likely be attached to the parent domain) and update the a-record to point to that IP as well. Then synchronize the zone out to the DNS cluster, if one exists: /scripts/dnscluster synczone <parentdomain>
- You will need to either edit: /etc/domainips (if the site was http) or: /etc/ssldomains (if the site was https) and change the ip in the file to the same ip you set above. If there is nothing in this file the format is: sub.domain.com: 255.255.255.255
- Now run the following command: /scripts/rebuildhttpdconf
- Now run /scripts/rebuildippool to assure the ip is marked as taken.
- Restart apache and the site should now respond to the IP address you assigned.





