Add a Dedicated IP to a subdomain or addon domain

On this post we will show you how to add a dedicated IP to a subdomain or addon domain without creating any account from WHM.
For this, we will need to edit some cPanel configuration and Apache configuration files. Let’s start.

1. Edit your subdomain or addon domain configuration file:

nano -w /var/cpanel/userdata/usuario/

Content should be similar to this:

 format: combined
 target: /usr/local/apache/domlogs/
 format: "\"%{%s}t %I .\\n%{%s}t %O .\""
 target: /usr/local/apache/domlogs/
documentroot: /home/username/public_html
group: Group1
hascgi: 1
homedir: /home/username
owner: username
phpopenbasedirprotect: 1
port: 80
 path: /home/username/public_html/cgi-bin
 url: /cgi-bin/
 path: /home/username/public_html/cgi-bin/
 url: /cgi-bin/
serveradmin: [email protected]
usecanonicalname: 'Off'
user: username
userdirprotect: ''

2. Edit the IP line and add your new IP, as you see below:


Save the changes now.

3. Rebuild and restart Apache to apply changes:


4. Edit the A registry at the DNS records for the subdomain/domain chosen, and add the new IP address. You can do this from WHM > Edit DNS Zone.

5. Finally, mark your IP as reserved from WHM > Show/Edit Reserved IPs

If you need any additional help regarding this, check out the cPanel original documentation from here.

About the Author: Santiago Borges

Experienced Sr. Linux SysAdmin and Web Technologist, passionate about building tools, automating processes, fixing server issues, troubleshooting, securing and optimizing high traffic websites.

Leave a Reply

Your email address will not be published. Required fields are marked *