Featured Posts

Using DKIM with Exim and cPanel Similar to the intentions of SPF records and DomainKeys, DKIM is intended to authenticate a sender by using a public/private key pair to digitally sign email, therefore increasing deliverability. At this...

Readmore

Copy Outgoing Email on a cPanel Server with Exim A common request we get is how a user can automatically BCC outgoing email to another address. This is most often requested by law firms that need to be able to retain copies of communication. Forwarding...

Readmore

Do You Care About Your Customers' Data? I was working a case last week for a new client that's been hosting local business websites for over three years. As with all of my case studies, I did a short survey of the client's infrastructure, processes,...

Readmore

Tips to Reduce Your Customer Support Costs When hosting websites, whether as a mainstream hosting provider, a hobby, or to supplement another service, it's your job to make sure your customers have access to technical support in case they need...

Readmore

Roundcube: MySQL or SQLite? cPanel 11.25 introduces a new feature: The ability to have RoundCube use SQLite instead of MySQL. After benchmarking resource usage and performance, I've come to the conclusion that SQLite is definitely...

Readmore

The cPanel Admin Rss

How to Assign an IP To Multiple cPanel Accounts

Posted by Vanessa | Tagged under , | Posted on February 17, 2010

1

Cpanel 11.25 introduces a new feature to allow you to set a reseller’s shared IP to be different from that of the server’s shared IP. This feature can be activated in WHM > Reseller Center > Manage reseller’s shared/main IP.  While this will allow you to have multiple accounts on the same IP, those accounts have to be owned by the reseller and will all be using the same IP. What if you have a dedicated IP that you want a couple accounts to share?  There’s currently no built-in cPanel functionality to do this, but you can alter a couple files to make it happen.

This walkthrough is for changing the IP of a domain/account to one that is already taken by another account. If you’re simply changing the site’s IP to one that is free, use the WHM > Change Site’s IP Address function instead.

Change the DNS

You can edit the DNS zone in WHM > Edit DNS Zone, or edit /var/named/yourdomain.com.db directly to point the domain to the desired IP on the server. Make sure to increment the serial number, then run /scripts/dnscluster synczone yourdomain.com  to sync it up to your nameservers. If you’re using external DNS, you’ll obviously need to point the domain in those nameservers instead.

Edit the cPanel Files

You need to change instances of the old IP to the new IP in the following locations, replacing $user with the username of the account, and $domain with the domain you are changing the IP for.

/var/cpanel/users/$user

/var/cpanel/userdata/$user/$domain

Now, add the IP to /etc/domainips in the same format as the others:

xxx.xxx.xxx.xxx: $domain

Build the Configs

Now rebuild the Apache config:

/scripts/rebuildhttpdconf

service httpd restart

That site should now be using the IP you specified. Keep in mind that if your ISP is caching the old IP, your default server page will show up instead of your website, until the IP change is propagated. This can take 4-24 hours.

*This technique is also used to assign multiple IPs to addon domains of a cPanel account. Follow the same procedure, only edit the config files for the domains you are changing.

Liking this article? Share it and spread the word!
  • Print
  • PDF
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • DZone
  • LinkedIn
  • Live
  • MySpace
  • RSS
  • Reddit
  • Slashdot
  • StumbleUpon
  • Technorati
  • Twitter

Related posts:

Comments (1)

[...] How to Assign an IP To Multiple cPanel Accounts :: The cPanel Admin __________________ http://www.thecpaneladmin.com http://www.v-nessa.net [...]

Write a comment