cPanel & WHM Version 114 has been released, and brings a slew of great updates. Take a look at what is included, and then upgrade today!

Comamnd line alternative to WHM "Change Multiple Sites' IP Addresses"

Ali Laraaj shared this idea 18 months ago
Not Planned

I have been searching everywhere for a function to assign a single IP to multiple domains or Cpanel accounts from the command line. but there is no function for that in Cpanel or it's command line

APIs, the only function close to what i need is the WHM API function whmapi1 setsiteip, which only assign an IP as a dedicated IP to an account. f2b3c156991ef324e1f6760bcf99fd27

Replies (4)



I'm not sure if it meets your needs, but a current supported way to do this is to have the accounts owned by the same reseller and have that reseller have the sharedip you desire:

Dustin Scherer (he/him) | Product Owner | @dustinscherer



Thanks for your reply, fist i don't think you can assign an IP to a reseller from command line,

and even if that's possible we have hundreds of IPs and hundreds of Cpanel accounts,

we will have to create hundreds of reseller accounts which will make the management

of all those reseller accounts and their IPs very complicated.

worst of all is when you migrate the server the command line tool /scripts/restorepkg

doesn't assign the same shard IPs, it only assign them as dedicated IPs.

The design of Cpanel was focusing on building a solution for shared hosting with resellers

and limited number IPs, but now the world has changed and with the introduction of IPv6

Cpanel has to adapt, because Cpanel is nologner only targeting shared hosting companies

but it's being used by different companies and individuals that works in completely different

fields and who uses Cpanel to mainly manage different accounts with multiple domains with

each domain or multiple domains assigned different IPs.

this kind of implementation will be more and more common with IPv6 since the IPs are cheaper

and more available compared to IPv4.

I think marking IPs as shared by default will be the best solution for all this, unless it's necessary then

the IP can be reserved or market as a dedicated IP.

I didn't have a chance yet to dig a little bit into how Cpanel mark IPs as shared or dedicated, but that was

going to be the best solution for my issue. because i added the same IP blocks that were used on the

old server to the new server and when i started restoring accounts using /scripts/restorepkg i got

a big bummer because the IPs were market as shared by default so first account that used a shared

IP on the old server get assigned that same IP as a dedicated IP, and the other Cpanel accounts that

were sharing that same IP on the old server just fail to restore if i specify that IP to be used,

otherwise if no IP is specified they are restored with the server's default IP. and i had to rearrange

IPs manually because there was no command line tool to assign shared IPs to multiple accounts.

All these issues can be solved by simply allowing IPs to be market as shared.


Thanks Ali for the additional information! It looks like there's definitely some room for improvement in this area. I'm going to mark this one "Not Planned" for the time being until we have an official place for it on the roadmap.

Dustin Scherer (he/him) | Product Owner | @dustinscherer



It has been a year and half for my first post, we really need this functionality, Whenever we migrate servers we get stock with having to end up assigning IPs manually, please please please at least unlock "WHM API function whmapi1 setsiteip" to assign same IP to multiple Users.

Leave a Comment
Attach a file