Changing a Site’s IP Address
- Written by Vanessa Vasile
- Published in Apache, DNS, Howto, Networking
- 9 Comments
- Permalink
There are three ways to change a site’s IP address on a cPanel server:
Via WHM:
Go to WHM > Change site’s IP Address , select the account, then select the IP
Via Command Line:
/usr/local/cpanel/bin/setsiteip -u $user $ip
Manually:
(This is also useful for changing the IP address of a single domain in an account, without affecting other domains on that account)
1) Edit /var/named/domain.com.db, change the domain’s A records, increment the serial number, and sync the zone out. For help in changing DNS, see this post. To sync a zone:
/scripts/dnscluster synczone $domain
Obviously, you do this on whatever server acts as a nameserver for the domain in question.
2) Replace instances of the old IP with the new IP in /var/cpanel/userdata and /var/cpanel/users
replace 123.123.123.123 222.222.222.222 — /var/cpanel/userdata/user/*
replace 123.123.123.123 222.222.222.222 — /var/cpanel/users/user
3) If the new IP is shared, remove the user’s main domain entry from /etc/domainips. If it’s a dedicated IP, add/change the IP in /etc/domainips and /etc/ssldomains (if the site has an SSL)
4) Run /scripts/rebuildhttpconf and /scripts/rebuildippool, and restart Apache
9 Comments
Pingback: Installing A Wildcard SSL Certificate :: The cPanel Admin
Pingback: Changing the Shared IP Address of a Live Server | Cheap Webhosting Domain Register
Pingback: Changing the Shared IP Address of a Live Server | BEC Community Blog
hah! I feel dumb. I didn’t know this:
/usr/local/cpanel/bin/swapip
When doing it from the command line.. I always did it the manual way. The more you know lol.
Pingback: SERVERTECHS » Blog Archive » Installing A Wildcard SSL Certificate
hi this manual is’nt enough
plz more help!
could u please tell me how to add multiple ip in a cpanel?
Pingback: Installing A Wildcard SSL Certificate
Pingback: cPanel :: Change Website's IP | :: b l a c k o n s o l e ::