Newb Q - why does WHM create these zones?

raindog308

Member
Apr 16, 2012
20
0
51
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.
 
Last edited:

JayFromEpic

Well-Known Member
Apr 2, 2011
218
8
68
Scottsdale
cPanel Access Level
Root Administrator
Twitter
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.
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
40
248
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.