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.

Parameters

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

Example

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

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 127.0.0.0 208.77.188.166 
208.77.188.166 example.com
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 127.0.0.0 208.77.188.166 example.com
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