Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Changing WHM Server IP with NAT Enabled

Discussion in 'Bind/DNS/Nameserver' started by Aaron Hatton, May 26, 2015.

  1. Aaron Hatton

    Aaron Hatton Active Member

    Jun 19, 2012
    Likes Received:
    Trophy Points:
    London, United Kingdom
    cPanel Access Level:
    Root Administrator
    I just had an issue with regards to the change of our WHM servers IP address, as this server is using NAT and the server is configured for a private IP as opposed to a public it was throwing up errors when attempting to access basic server configuration etc.

    I did a lot of research to try and fix the issue however could not find a straight forward answer so am posting this to help someone else out should they have an issue.

    The Steps

    I initially followed this guide: How to change the primary IP address of a WHM/cPanel server which was useful in regards to getting access to the server once again however the next challenge I faced was the errors when accessing the Basic cPanel & WHM Setup page within WHM and any IP Functions

    I found the following NAT Documentation provided by cPanel: NAT Documentation which advised of a file called "/var/cpanel/cpnat" which I needed to edit, I did this and restarted the server but to no avail.

    Further down the page is mention of a NAT Build script, I thought it was a long shot but gave it a go regardless and ran the command "/scripts/build_cpnat" (Nothing is ever this simple!)

    To my surprise this got it working straight away, a quick change of the configuration within the Basic cPanel & WHM Setup for the section "The IP address (only one address) that will be used for setting up shared IP virtual hosts." to the new IP and it is done!


    It does seam on this occasion things can sometimes be simple if you find the correct article, it would be good to see if anyone else had this experience and if I did one too many steps in order to fix this or if I am missing some which will cause issues at a later date.

    It was however a good challenge and one I now know what to do for next time, I hope this helps save someone else the panic I had...
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager Staff Member

    Apr 11, 2011
    Likes Received:
    Trophy Points:
    cPanel Access Level:
    Root Administrator

    I am happy to see the issue is now resolved. However, do keep in mind that per our documentation, we strongly recommend that you only perform these actions on a fresh installation of cPanel & WHM. Do not attempt a 1:1 NAT configuration on an existing production server.

    Thank you.
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice