The swapip Utility

The swapip utility allows you to update nameserver records by specifying 4 parameters in a command line interface. This can be useful if, for example, you have moved an account from one server to another and did not use the Express Transfer option.

PICK Remember: All 4 of the input parameters associated with this utility are required.

Using the swapip utility

The swapip utility is located at /usr/local/cpanel/bin/swapip

To use this utility, execute the following, specifying the appropriate parameters:

  • /usr/local/cpanel/bin/swapip $sourceip $targetip $ftpip $domains
    • PICK Remember: $sourceip, $targetip, $ftpip, and $domains are meant to symbolize the parameters you wish to enter. See below for more information.


  • sourceip (string) — The old IP address.
    • Example:
  • targetip (string) — The new IP address.
    • Example:
  • ftpip (string) — The new FTP server's IP address.
    • Example:
  • domains (string) — One or more domains associated with the IP address being changed.
    • Example:
    • note Note: You may enter more than one domain by separating each new domain with a space ( ).


Typing /usr/local/cpanel/bin/swapip would change the nameserver records for on to point HTTP and FTP requests to

A successful swapip attempt should return you to the command line without displaying any messages. The output should resemble the following:

root@example [~]# /usr/local/cpanel/bin/swapip
root@example [~]# 

An unsuccessful swapip attempt should result in an error message, the output of which will resemble the following:

root@example [~]# /usr/local/cpanel/bin/swapip
Error: domains missing
Usage: /usr/local/cpanel/bin/swapip sourceip destip ftpip domains...

note Note: At this time the error message may not give an accurate assessment of the error that has occurred.

Topic revision: r3 - 27 Nov 2009 - 17:20:19 - MelanieSeibert