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
Parameters
The example above uses the following parameters:
Example Input type Description Example parameter ------------------------------------------------------------------------------------------------- Sourceip string The old IP address. 127.0.0.0 Targetip string The new IP address. 208.77.188.166 Ftpip string The new FTP server’s IP address. 208.77.188.166 domains string One or more domains that are associated example.com with the old IP address. Space-separate multiple domain names.
Example
To change the nameserver records for the example.com domain on the 127.0.0.0 IP address in order to point HTTP and FTP requests to the 208.77.188.166 IP address, run the following command:
/usr/local/cpanel/bin/swapip 127.0.0.0 208.77.188.166 208.77.188.166 example.com
If the swapip utility does not succeed, the output will resemble the following example:
- 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…
If the swapip utility succeeds, the output will resemble the following example:
- root@example [~]# /usr/local/cpanel/bin/swapip 127.0.0.0 208.77.188.166
- 77.188.166 example.com
- root@example [~]#