The swapip utility enables you to determine parameters from the command line so as to refresh nameserver records. This is valuable, for instance, in the event that you moved a record starting with one server then onto the next and did not utilize the Express Transfer choice in WHM’s Transfer Tool interface (WHM >> Home >> Transfers >> Transfer Tool).


 The Swapip Utility

The swapip utility resides in the /usr/local/cpanel/bin/swapip file.


To utilize this utility, run the accompanying order:

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



The example above uses the following parameters:

Example         Input type      Description		        		Example			
Sourceip	string	        The old IP address.
Targetip	string	        The new IP address.
Ftpip	        string	        The new FTP server’s IP address.
domains	        string	        One or more domains that are associated
				with the old IP address. Space-separate 
				multiple domain names.				



To change the nameserver records for the domain on the IP address in order to point HTTP and FTP requests to the IP address, run the following command:



If the swapip utility does not succeed, the output will resemble the following example:

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


If the swapip utility succeeds, the output will resemble the following example:

  • root@example [~]# /usr/local/cpanel/bin/swapip
  • 77.188.166
  • root@example [~]#
Was this answer helpful? 0 Users Found This Useful (0 Votes)