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!

Adding internal ip address of main domains

Discussion in 'General Discussion' started by Geo Grav, Nov 13, 2017.

  1. Geo Grav

    Geo Grav Member

    Joined:
    Feb 7, 2016
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Victorial, Australia
    cPanel Access Level:
    Root Administrator
    We have a NAT'ed cpanel server and we have been find that some web plugins will look up the address for the and obtain the external address. Requests to that address will not come back to the server.

    We have been manually adding entries into the /etc/hosts file to over come this issue.

    Does someone have a script that will do this automatically?

    As very rough pseudocode:
    whmapi1 listaccounts
    for each non-suspended account, get the ip address via dns.
    if returned address is external server address, add the host-name alongwith internal address to /etc/hosts

    Oh, there probably needs to be a remove step there also.
     
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,827
    Likes Received:
    1,898
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    I'll leave this thread open for user-feedback regarding discussion of the custom script, however I did want to make sure you were aware of the following document:

    1:1 NAT - Version 68 Documentation - cPanel Documentation

    Is the /var/cpanel/cpnat file already populated on this server?

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. Geo Grav

    Geo Grav Member

    Joined:
    Feb 7, 2016
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Victorial, Australia
    cPanel Access Level:
    Root Administrator
    Yes, I was aware of that documentation page.

    And yes, the /var/cpanel/cpnat has already been populated with the correct addresses.
     
  4. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,827
    Likes Received:
    1,898
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    I'm not aware of any existing scripts that will perform those actions, however we provide a list of system admin services if you need help developing the custom script:

    System Administration Services | cPanel Forums

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

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