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.

Newb Q - why does WHM create these zones?

Discussion in 'General Discussion' started by raindog308, Apr 16, 2012.

  1. raindog308

    raindog308 Member

    Joined:
    Apr 16, 2012
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    My VPS provider installed cPanel/WHM for me.

    When I go into DNS functions, I see three zones created:

    • ns1.example.com
    • ns2.example.com
    • host.example.com

    ...where "example.com" is my domain and "host" is the hostname I chose.

    The ns1 zone has these records:

    Code:
    ns1.example.com. IN A...
    localhost.ns1.example.com. IN A 127.0.0.1
    ns1.example.com. IN MX 0 ns1.example.com.
    mail IN CNAME ns1.example.com.
    www IN CNAME ns1.example.com.
    ftp IN CNAME ns1.example.com.
    
    ns2 is the same.

    host.example.com is

    Code:
    host.example.com. IN A ...
    localhost.host.example.com. IN A 127.0.0.1
    host.example.com. IN MX 0 host.example.com.
    mail IN CNAME host.example.com.
    www IN CNAME host.example.com.
    ftp IN CNAME host.example.com.
    
    What I don't understand is...
    • why not create a single example.com zone?
    • why the localhost records?
    • why define mail, www, ftp, etc. aliases in each zone?

    I know how DNS works - just trying to understand WHM's approach to it.
     
    #1 raindog308, Apr 16, 2012
    Last edited: Apr 16, 2012
  2. JayFromEpic

    JayFromEpic Well-Known Member

    Joined:
    Apr 2, 2011
    Messages:
    204
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Scottsdale, AZ
    cPanel Access Level:
    Root Administrator
    That is simply the easiest and most configurable way of managing DNS I suppose. A separate zone is created for each nameserver as well as the hostname. The zone file for NS1 and NS2 are not the same, the IP listed in there is different per each zone since you have a different IP for each nameserver.
     
  3. raindog308

    raindog308 Member

    Joined:
    Apr 16, 2012
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Oh yes, the IP in ns1 and ns2 is different - I just meant the format was identical.
     
  4. JayFromEpic

    JayFromEpic Well-Known Member

    Joined:
    Apr 2, 2011
    Messages:
    204
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Scottsdale, AZ
    cPanel Access Level:
    Root Administrator
    Right, the format is the same. It just happens to be the way cPanel/WHM works. I tell you what though, I would much rather do DNS work with WHM then by doing everything from command.
     
  5. 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
    Actually, if you had already created the cPanel account at the onset before adding the ns1 and ns2 entries, you'd have gotten those entries in the example.com.db zone file in /var/named location. The server will only create the zones you request. Since the example.com zone didn't exist yet, that zone didn't get created and there was no choice for the nameservers to function but to create separate zones for them.

    If you want to see what I'm saying occur, feel free to make a backup of the nameserver zones to /root, then remove the zones. At that point, create an account called example.com and then re-add the nameserver entries in WHM > Basic cPanel & WHM Setup. You'll see the nameservers get added to the example.com zone then.
     
Loading...

Share This Page