{"id":339,"date":"2009-11-20T15:41:58","date_gmt":"2009-11-20T19:41:58","guid":{"rendered":"http:\/\/linuxhostingsupport.net\/blog\/?p=339"},"modified":"2013-03-30T06:50:25","modified_gmt":"2013-03-30T10:50:25","slug":"script-to-change-ip-address-of-all-the-accounts","status":"publish","type":"post","link":"https:\/\/linuxhostingsupport.net\/blog\/script-to-change-ip-address-of-all-the-accounts","title":{"rendered":"Script to change IP address of all the accounts."},"content":{"rendered":"<blockquote><p><span style=\"color: #0000ff;\"><strong>How to change IP address of all the accounts on a cPanel server?<\/strong><\/span><\/p><\/blockquote>\n<p>The <strong>&#8220;Change Site IP Address&#8221; option is WHM is not feasible<\/strong> in case you need to change IP address of all the accounts on a server. In order to change IP address of all the domains on a cPanel server, you have to <strong>use the &#8220;swapip&#8221; script provided by cPanel.<\/strong><\/p>\n<p>The following script will do the needful:<\/p>\n<blockquote><p><span style=\"color: #0000ff;\"><strong>for i in `cat \/etc\/trueuserdomains | cut -d: -f1`<br \/>\ndo<br \/>\n\/usr\/local\/cpanel\/bin\/swapip OLDIP NEWIP $i;<br \/>\ndone;<\/strong><\/span><\/p><\/blockquote>\n<p><strong>where,<\/strong><\/p>\n<blockquote><p><strong><span style=\"color: #0000ff;\">OLDIP is the current IP assigned to the domain.<br \/>\nNEWIP is the new IP which you would like to assign.<br \/>\n$i is the domain names read per line from the \/etc\/trueuserdomains file.<\/span><\/strong><\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>How to change IP address of all the accounts on a cPanel server?<br \/>\nThe &#8220;Change Site IP Address&#8221; option is WHM is not feasible in case you need to change IP address of all the accounts on a server. In order to change IP address of all the domains on a cPanel server, you have to use the &#8220;swapip&#8221; script provided by cPanel.<br \/>\nThe following script will do the needful:<br \/>\nfor i in `cat \/etc\/trueuserdomains | cut -d: -f1`<br \/>\ndo<br \/>\n\/usr\/local\/cpanel\/bin\/swapip OLDIP NEWIP $i;<br \/>\ndone;<br \/>\nwhere,<br \/>\nOLDIP is the current IP assigned to the domain.<br \/>\nNEWIP is [&#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":[423,421,420,422,424,426,425],"_links":{"self":[{"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/posts\/339"}],"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=339"}],"version-history":[{"count":3,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/posts\/339\/revisions"}],"predecessor-version":[{"id":341,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/posts\/339\/revisions\/341"}],"wp:attachment":[{"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/media?parent=339"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/categories?post=339"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxhostingsupport.net\/blog\/wp-json\/wp\/v2\/tags?post=339"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}