{"id":1295,"date":"2011-03-08T14:22:45","date_gmt":"2011-03-08T18:22:45","guid":{"rendered":"http:\/\/linuxhostingsupport.net\/blog\/?p=1295"},"modified":"2013-03-20T08:43:56","modified_gmt":"2013-03-20T12:43:56","slug":"how-to-assign-a-dedicated-ip-to-a-sub-domain-or-add-onpark-domain","status":"publish","type":"post","link":"https:\/\/linuxhostingsupport.net\/blog\/how-to-assign-a-dedicated-ip-to-a-sub-domain-or-add-onpark-domain","title":{"rendered":"How to assign a dedicated IP to a Sub-domain OR Add-on\/Park domain?"},"content":{"rendered":"<p><strong>By default, cPanel allows one IP per account<\/strong>, however, in case you wish to assign multiple IPs to an account, say for a sub-domain, you can do so by editing a few files. Follow the below steps:<\/p>\n<p><span style=\"color: #0000ff;\"><strong>1)<\/strong><\/span> The main configuration file of a domain is stored under the \/var\/cpanel\/userdata\/&lt;username&gt;\/ directory, so edit the subdomain related file under it<\/p>\n<blockquote>\n<pre><span style=\"color: #0000ff;\"># vi \/var\/cpanel\/userdata\/&lt;username&gt;\/subdomain.domain.tld<\/span><\/pre>\n<\/blockquote>\n<p>Change the value of &#8220;IP&#8221; to a dedicated IP and save the file. The add-on and Park domains have their related subdomain files in the same directory.<\/p>\n<p><span style=\"color: #0000ff;\"><strong>2)<\/strong><\/span> Now, rebuild the Apache configuration for the changes to take affect in the respective VirtualHost entry<\/p>\n<blockquote>\n<pre><span style=\"color: #0000ff;\"># \/scripts\/rebuildhttpdconf <\/span><\/pre>\n<\/blockquote>\n<p><span style=\"color: #0000ff;\"><strong>3)<\/strong><\/span> Restart the Apache webserver<\/p>\n<blockquote>\n<pre><span style=\"color: #0000ff;\"># service httpd restart<\/span><\/pre>\n<\/blockquote>\n<p><span style=\"color: #0000ff;\"><strong>4)<\/strong><\/span> Add the dedicated IP and sub-domain in the \/etc\/domainips file to mark the dedicated IP as assigned so WHM won&#8217;t be able to assign it to other domains.<\/p>\n<blockquote>\n<pre><span style=\"color: #0000ff;\">dedicatedIP: subdomain.domain.tld<\/span><\/pre>\n<\/blockquote>\n<p>Save the file and rebuild the IP pool<\/p>\n<blockquote>\n<pre><span style=\"color: #0000ff;\"># \/scripts\/rebuildippool<\/span><\/pre>\n<\/blockquote>\n<p><span style=\"color: #0000ff;\"><strong>5)<\/strong><\/span> Now, edit the DNS zone file of the main domain (i.e. the domain under which the sub-domain is created) and add an &#8216;A&#8217; record for the sub-domain to point to the new IP.<\/p>\n<blockquote>\n<pre><span style=\"color: #0000ff;\"># vi \/var\/named\/domain.tld.db<\/span><\/pre>\n<\/blockquote>\n<p>Save the file and restart the &#8216;named&#8217; service<\/p>\n<blockquote>\n<pre><span style=\"color: #0000ff;\"># service named restart<\/span><\/pre>\n<\/blockquote>\n<p>Allow sometime for the new IP to propagate.<\/p>\n<p><span style=\"color: #0000ff;\"><strong>Note:<\/strong><\/span> Rebuilding the IP pool will still list the IP as free under the WHM -&gt; IP Function -&gt; &#8216;Show IP Address Usage&#8217;, however WHM wont allow you to assign that IP to another domain.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>By default, cPanel allows one IP per account, however, in case you wish to assign multiple IPs to an account, say for a sub-domain, you can do so by editing a few files. Follow the below steps:<br \/>\n1) The main configuration file of a domain is stored under the \/var\/cpanel\/userdata\/&lt;username&gt;\/ directory, so edit the subdomain related file under it<\/p>\n<p># vi \/var\/cpanel\/userdata\/&lt;username&gt;\/subdomain.domain.tld<\/p>\n<p>Change the value of &#8220;IP&#8221; to a dedicated IP and save the file. The add-on and Park domains have their related subdomain files in the same directory.<br \/>\n2) Now, rebuild [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[1201,1200,1202,1203],"_links":{"self":[{"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/posts\/1295"}],"collection":[{"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/comments?post=1295"}],"version-history":[{"count":11,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/posts\/1295\/revisions"}],"predecessor-version":[{"id":2261,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/posts\/1295\/revisions\/2261"}],"wp:attachment":[{"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/media?parent=1295"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/categories?post=1295"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/tags?post=1295"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}