SOLVED Problem creating new account with custom ip

keryfan

Member
Feb 21, 2018
7
2
3
Ukraine
cPanel Access Level
Root Administrator
Hello,

i faced some problems with creating new user accounts via json-api. The server has 4 ips, all ips are shared and added to file /var/cpanel/mainips/root.

[removed]

I can easily change ip of user account in WHM after creation, but when creating account with createacct function, parameter customip is ignored and account always creating on ip, which is on the first line of of file /var/cpanel/mainips/root.

Examle of api call

whmapi1 createacct username=user domain=example.com plan=custom_plan featurelist=default quota=0 password=randompass customip=ip_address cgi=1 hasshell=1 contactemail=user%40seconddomain.com cpmod=paper_lantern language=en useregns=1 hasuseregns=1 reseller=0 forcedns=1 mailbox_format=mdbox mxcheck=local max_email_per_hour=500 max_defer_fail_percentage=80 owner=root

The system is up to date and WHM\Cpanel version is 68.0.29.
Help is very much appreciated.
 
Last edited by a moderator:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,913
2,202
363
whmapi1 createacct username=user domain=example.com plan=custom_plan featurelist=default quota=0 password=randompass customip=ip_address cgi=1 hasshell=1 contactemail=user%40seconddomain.com cpmod=paper_lantern language=en useregns=1 hasuseregns=1 reseller=0 forcedns=1 mailbox_format=mdbox mxcheck=local max_email_per_hour=500 max_defer_fail_percentage=80 owner=root
Hello,

The "customip" parameter is utilized to define a specific available IP address if you use "ip=y" as a parameter when creating the account. This matches the behavior you'd see when creating the account via Web Host Manager. The IP address needs to be available to assign to an account as a dedicated IP address, as opposed to being a shared IP address that's available to multiple accounts.

Thank you.