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!

Got cPanel running behind NAT? I need you!

Discussion in 'General Discussion' started by digrain, Jul 1, 2009.

  1. digrain

    digrain Registered

    Jul 1, 2009
    Likes Received:
    Trophy Points:
    First let me say that I am not a *total* n00b when it comes to cPanel and WHM. I've been using both for years - but only after it has already been installed and configured.

    My boss bought the cPanel license today and we had cPanel and WHM installed today. I went through the setup process correctly (I thought) but when I tried to set up a domain account for a site we're building, I can't connect to it. I just get an address not found error.

    I've spoken w/ the company providing the server, and they're a great bunch of guys, but cPanel is not their forte.

    The server is behind a NAT firewall which means that I have to have a private IP resolve to a public IP. I have a block of 8 ip addresses, once of which is already being resolved to by a private IP (this is the IP that I am able to access the WHM through).

    Also, although DNS has been set up for the hostname, I don't know how to set them up for each domain account that I create. In the past with other hosts, I've used the same ns1 and ns2 nameservers for every account I've created on my VPS.

    Can I do that here, and if so, how? Does there need to be one set of nameservers for the hostname and one to handle all of the domain accounts that get set up on the server?

    See what I'm facing here?

    I need help getting WHM configured properly behind the NAT firewall.

    Any help would be SO very much appreciated.


  2. Spiral

    Spiral BANNED

    Jun 24, 2005
    Likes Received:
    Trophy Points:
    I guess that's a matter of perspective then because I'd still consider that "n00b" ;)

    (But then look at my perspective managing servers for more than 30 years
    and also Cpanel and WHM all the way back to it's beginnings as well and I handle
    cPanel at every aspect from the base server before installation, installing, post
    installation configuration, customizing, unusual modifications, programming, etc)

    Assuming you setup the licensing and IPs correctly and got everything
    installed properly, you need to also make sure that both your Apache
    (httpd) and your DNS servers (named) are actually up and running.

    The first thing is to check your Apache status and make sure that your
    web server is in fact up and running and you will also want to connect
    to the IP of the server directly to make sure you get the default page
    shown which also further verifies your server is up and running.

    Now, when you setup your sites. Do remember that it takes time for
    any DNS changes to be updated and your domains may be pointing
    to the wrong servers when you try to via the domain name. To
    complicate matters, if you previously connected to your domain at
    another server location, your computer or even your ISP may have
    the routing information cached and may try to connect to the wrong
    IP address even though the DNS may actually resolve correctly.

    Lucky for you cPanel is actually our 'Forte' and is a specialty and I'd be
    glad to help you any way I can. I myself spend a great deal of time each
    week towards doing what I can to try to help out cPanel users.

    NAT Translation (if that is what you really have setup) can be a little bit
    tricky under Cpanel particularily with getting everything working and
    your license being recognized and working correctly. Some would say
    this sort of configuration is impossible but that is not really the case,
    it's just a little more tricky to setup. I have done a number of these
    with reverse proxies and a few creative scripts and they work okay.

    In your case though, is there a specific reason for your server being
    deployed with NAT translation? If you have a CIDR/29 block, it would
    seem to make more sense setting up this and allocating one or more of
    the IPs in the block to shared than to use a private NAT translation.

    Perhaps I'm missing something in your situation? If you describe to me
    exactly what you are wanting to do, I might be better able to tell you
    the best way of going about doing it.

    The DNS zone files are created automatically for each domain you setup
    on your Cpanel account using the DNS server names as the hostname domain
    for "root" owned accounts or the DNS servers of the reseller primary hostname
    for those accounts setup under reseller accounts.

    As far as what DNS addresses to use at the registrar for the authoritative
    DNS server addresses, those you have to setup at your domain registrar
    and simply map the "host" DNS server names to IPs located at your server.

    You could just setup the DNS servers for your primary hostname domain
    and then have all domains use those same nameservers you setup or you
    could have each domain have a DNS address setup using it's own domain
    but mapped to the same identical IP address as your hostname DNS servers.

    Either way will work. The actual DNS server host to IP mapping is again
    done at your registrar and each registrar has their own setup for this so
    instructions will vary. I deal with Go Daddy a lot and their host setup to
    setup DNS servers is very easy and all you really need with you is the IP
    addresses from your server and you can set that up in a few seconds and
    then just simply match the same information later in your domain zone files
    so that everything is all synced up on both ends nice and tight.

    The actual DNS content, IP resolution entries, and zone files for your
    domains is all setup on your Cpanel server directly and cPanel will handle
    most all of this for you automatically behind the scenes without you having
    to reallly know much about it (although it helps to understand how it works).

    The only thing you need to setup at your domain registrar off your server
    is the DNS server names themselves.

    In example, say I have "" as my primary domain.

    At my registrar where I bought the domain, I might setup DNS server
    addresses of "" and "" which each
    maps to IP addresses located on my cPanel server and set these new
    DNS addresses as the authoritative DNS servers for ""

    On my cPanel server, I would setup login to WHM ( and go into "Basic cPanel/WHM Setup"
    and tell cPanel under "NameServers" that I wanted all domains on the server
    to use "" and "" as the nameservers.

    Once you have the basic setup, any new domains you add to the server
    would just be a simple matter of setting the DNS servers on those domains
    to "" and "" and cPanel would take
    care of the rest by already automatically adding zone files when you
    create the new hosting accounts.

    Not really. You have not really explained why you want to setup your
    server behind a NAT firewall or what your specific reason is in doing this.

    I will be glad to help you all I can and we can chat more privately
    if you have a longer list of questions. I just need to know more
    specifically what it is that you are really trying to do or what
    your line of thinking is in trying to setup the way you are asking
    and I'll try to give you a hand with that.
    #2 Spiral, Jul 2, 2009
    Last edited: Jul 2, 2009

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