BuycPanel Blog

BuycPanel Blog

Latest news and updates

What is the Swapip Interface in WHM?

Posted by Allura on 01 02 2019.

Introduction
This interface allows one to determine the parameters from the command line in updating nameserver records. This can be useful in case if an account is moved from one server to another and did not utilise the Express Transfer  option in WHM’s Transfer Tool interface (WHM >> Home >> Transfers >> Transfer Tool).

The Swapip Utility
The /usr/local/cpanel/bin/swapip file keeps the feature of swapip utility.

One can use the following command to work on this feature:

/usr/local/cpanel/bin/swapip sourceip targetip ftpip domains

There are various parameters that are used for this purpose, and all of these parameters are required for proper working of this utility. Input type of all these parameters are same, that is, string. The parameters are:

 	sourceip

Description: The old IP address.       Example: 127.0.0.0

 

 	targetip

Description: The new IP address.              Example: 208.77.188.166

 

 	ftpip

Description: New FTP server’s IP address

Example: 208.77.188.166

 

 	domains

Description: One or more domains      associated with the old IP address. Space-separate multiple domain names.

Example:…

Introduction

This interface allows one to determine the parameters from the command line in updating nameserver records. This can be useful in case if an account is moved from one server to another and did not utilise the Express Transfer  option in WHM’s Transfer Tool interface (WHM >> Home >> Transfers >> Transfer Tool).

The Swapip Utility

The /usr/local/cpanel/bin/swapip file keeps the feature of swapip utility.

One can use the following command to work on this feature:

/usr/local/cpanel/bin/swapip sourceip targetip ftpip domains

There are various parameters that are used for this purpose, and all of these parameters are required for proper working of this utility. Input type of all these parameters are same, that is, string. The parameters are:

  1. sourceip

Description: The old IP address.       Example: 127.0.0.0

 

  1. targetip

Description: The new IP address.              Example: 208.77.188.166

 

  1. ftpip

Description: New FTP server’s IP address

Example: 208.77.188.166

 

  1. domains

Description: One or more domains      associated with the old IP address. Space-separate multiple domain names.

Example: example.com

Example

One can run the following command in order to change the nameserver records for example.com domain on the 127.0.0.0 IP address in pointing HTTP and FTP requests to the 208.77.188.166 IP address:

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

If the utility fails to succeed, the output will look like this:

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…

And, if it succeeds, it will look like:

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

208.77.188.166 example.com

root@example [~]#

It is to note that during this time, the error message may fail to provide an accurate judgement of the error that will occur.

Conclusion

Everything about the swapip interface, its feature, working, parameters are outlined in this article.