Our documentation is getting an overhaul! We would like your input! Click here to take a look at the beta launch of our new documentation site! Only cPanel & WHM version 82 documentation exists on our beta at this time. 84 will be added to the new site soon! Leave your feedback here: https://go.cpanel.net/docsfeedback
The swapip Script - Version 82 Documentation - cPanel Documentation
Page tree
For cPanel & WHM version 82.

Skip to end of metadata
Go to start of metadata


Use this script to update a domain's IP address in the zone file. It will update the domain's source IP address with the destination server's IP address.

This script is useful for cPanel account transfers. When you transfer an account to a new server, you must update the account's DNS records to match. You should also use this script if you did not select the Express Transfer option in WHM's Transfer Tool interface (WHM >> Home >> Transfers >> Transfer Tool).

Run the script

To run this script on the command line, use the following format:

/usr/local/cpanel/bin/swapip [options]


Use the following options with this script:



The source IP address. This is the original IP address that you want to change a DNS record from.


The destination IP address. This is the IP address that you want to update a DNS record to.


The destination server's FTP IP address.


The associated domain name. For multiple domains, separate each with a comma.


You must pass this option last.



The --help option will not provide help documentation. Instead, the script will return an error message.


The following example changes the IP address (A record) in the DNS zone file for the example.com domain. It uses the IPv4 address to point HTTP and FTP requests to the IPv4 address:

/usr/local/cpanel/bin/swapip example.com

If the script succeeds, the output will look like the following:

The system updated “1” entry.

If the script fails, it returns an error message that looks like the following:

Error: domains missing
Usage: /usr/local/cpanel/bin/swapip sourceip destip ftpip domains...


The error message may not return an accurate assessment of the error that occurs.

Additional documentation