The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

cPanel behind NAT - DNS Zone Template

Discussion in 'Bind / DNS / Nameserver Issues' started by emilysnothere, Sep 20, 2011.

  1. emilysnothere

    emilysnothere Registered

    Joined:
    Sep 20, 2011
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Our cPanel / WHM is setup behind a NAT firewall, therefore, everytime a new hosting account is created all the A records are set to the IP behind the NAT firewall not the public IP. We have to manually go into 'edit DNS zone' and update all the A records. This also means that when a user adds on domains/ parked domains we have to manually go in and edit them, which is difficult if we don't know a client has added these to their hosting account.

    I have made the appropriate changes to the Zone Template so that the %domain$ IN A and ftp IN A are our public domains. When a new hosting account is created and they add an addon domain these are fine. However, the cpanel, whm, webmail, webdisk and any subdomains still have the internal IP.

    Is there anyway to change settings somewhere that these get updated with the public IP as well, rather than us having to manually change these each time a hosting account is created or a user adds a parked domain onto their hosting account?

    In addition, does it really matter if these point to the internal IP rather than the public IP? Will people still be able to get to the sub domain since the domain A record is correct?


    tl;dr - how can I code all the A records (not just those in Zone Template Editor) to have correct public IP not NAT IP? :eek:
     
  2. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,452
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    cPanel should not be installed behind a NAT. Many threads on this topic around the forum.
     
  3. fcbinfo

    fcbinfo Well-Known Member

    Joined:
    Dec 10, 2006
    Messages:
    120
    Likes Received:
    2
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Same problem here. The best datacenter of my country uses cloud server behind a nat, every account added i need to edit manualy

    cpanel 14400 IN A 10.1.146.2
    whm 14400 IN A 10.1.146.2
    webmail 14400 IN A 10.1.146.2
    webdisk 14400 IN A 10.1.146.2

    Are you have found a solution?
     
  4. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
  5. fcbinfo

    fcbinfo Well-Known Member

    Joined:
    Dec 10, 2006
    Messages:
    120
    Likes Received:
    2
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Let's see if I understand it. Only need to create a file inside the folder /scripts named postwwwacct ?

    Inside this file, what i need to write?

    Thank you again Tristan! But i think this will help a lot of people.
     
  6. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    Right, you'd need to create a file inside scripts called postwwwacct and have code to revise the zone template that is created.

    As for what you would need to write, that's a coding question and normally we allow the user to read through the documentation and determine how to code the correct script.

    You are welcome to try to review the documentation and, once you've gotten some script setup if it isn't working, to post over in the developer section to ask questions on it:

    cPanel Developers
     
  7. fcbinfo

    fcbinfo Well-Known Member

    Joined:
    Dec 10, 2006
    Messages:
    120
    Likes Received:
    2
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Well... im realy not able to do that. I'm sad.
     
  8. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
  9. fcbinfo

    fcbinfo Well-Known Member

    Joined:
    Dec 10, 2006
    Messages:
    120
    Likes Received:
    2
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
  10. fcbinfo

    fcbinfo Well-Known Member

    Joined:
    Dec 10, 2006
    Messages:
    120
    Likes Received:
    2
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Tristan... there's no file to edit this cpanel whm webdisk webmail entries like dns zone templates?

    Where cpanel get this configurations on create accounts?

    Have not found on

    /usr/local/cpanel/cpupdatepatches/var/cpanel/zonetemplates/__revision1/patches
    /usr/local/cpanel/etc/zonetemplates
    /var/cpanel/zonetemplates
     
    #10 fcbinfo, Nov 9, 2011
    Last edited: Nov 9, 2011
  11. fcbinfo

    fcbinfo Well-Known Member

    Joined:
    Dec 10, 2006
    Messages:
    120
    Likes Received:
    2
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    I have found it: /scripts/proxydomains

    But no way to configure IP.

    =(
     
  12. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    That's why I suggested to use a /scripts/postwwwacct hook instead, which you did ask for in the developer area.
     
  13. fcbinfo

    fcbinfo Well-Known Member

    Joined:
    Dec 10, 2006
    Messages:
    120
    Likes Received:
    2
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    It's hard to make this script, I'm trying to find another solution.

    Maybe no way... need to wait a reply on developer area.
     
  14. fcbinfo

    fcbinfo Well-Known Member

    Joined:
    Dec 10, 2006
    Messages:
    120
    Likes Received:
    2
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    Hello Tristan... a little help again.

    My file /etc/hosts need to put internal or external IP?

    Thank you.
     
  15. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    You should put the internal IP in /etc/hosts as far as I am aware, since /etc/hosts also works along with your networking files and those all use the internal IP.

    Of note, you will keep getting a warning about /etc/hosts and the hostname by cPanel due to this, but so long as it is working for the translation, the warning can be ignored.
     
  16. gruvin_nz

    gruvin_nz Registered

    Joined:
    Aug 16, 2007
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    If it's quite OK for you., we and many hundreds more as time go on will keep hammering cPanel to include support for this nowadays basic requirement "in the cloud".

    Cloud servers everywhere use NAT -- not all of them, but I believe soon most, if not all. Some believe IPv6 will replace the need for that. They are wrong. Many servers in an organisations private cloud be required to remain behind NAT for obvious security reasons.

    It is obvious to me that people at the top of the cPanel organisation have outdated personal opinions about NAT, perhaps going back to people running cPanel on home DSL connections and thus defiling the quality reputation of the product. It is a shame in my humble opinion that the world's leading control panel cannot get themselves out of the mud and catch up with reality. Many of us are hoping, waiting patiently for this attitude to change.
     
  17. InteractM

    InteractM Well-Known Member

    Joined:
    Apr 2, 2013
    Messages:
    133
    Likes Received:
    1
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    #17 InteractM, Apr 2, 2013
    Last edited: Apr 3, 2013
Loading...

Share This Page