DNS zones explained
DNS zones explained
DNS is comprised logically of Domains but physically of zones.
A domain is a logical division of the DNS namespace whereas a zone is physical, as the information is stored in a file called a zone file.
In most cases you have a 1 to 1 relationship between a Domain and a DNS Zone i.e. the domain mydomain.com would be stored in a zone file called mydomain.com.txt.
This tutorial is for beginners and you will learn:
What a DNS Zone Is.
What a Zone File is
How DNS Zones relate to Domains
Different Zone Types
How Zone transfer works
To Explain what zones and zone files and how they work are we are going to start with a simple analogy
If you imagine that you (Bill) have organized a football league that has three teams. Teams A,B,C and each team has 20 players in the squad. What you need is for anyone to be able to contact any player on any of the teams.
So you could create a paper list and write the names and phone numbers on it. This works but gets to be a problem if the league expands and you get,for example, 10 teams.
So an alternative is to create three lists one for teamA , one for teamB, and one for teamC. If another team gets added then you create another paper list for teamD.
So now you have three lists but who manages the lists?
Well each team has a manager so you let the manager handle the list for the team. So John manages teamA Fred manages teamB Jane manages teamC
Now the league organiser Bill wants the phone number of Steve who plays for TeamA. How does he get it? Well he first needs to know who has the player list for TeamA. So Bill needs a list with the name and phone numbers of all the managers.
The manager’s name isn’t really important just the phone number. So if someone wants to find the phone number of Steve on team A they contact Bill who returns the phone number of the manager of Team A (John).
They then contact John for the phone number of steve .
If you compare this to IP addresses and Domain names Steve = A web server, for example Phone number = the IP address TeamA = a Domain Name Bill,John,Fred,Jane are name servers.
The lists are zones or zone files Notice Bill doesn’t have a list of players but managers i.e it doesn’t contain hostnames (A records) but Manager names (name server records NS records).
Also Bill needs to know who has the team list for all of the teams below him, but John only needs to know the phone number for the Top of the Tree, which in this case is Bill as we have only two levels, but it doesn’t have to be.
Primary and Secondary Zones and Zone Transfer
What happens when a Manager goes on holiday?
Well all they need to do is to photocopy their list and give it to someone else (Barry for example), and tell Bill the Contact number of the person so Bill can update his list. Notice: In DNS there are always two name servers for resilience.
We also need to add a note in John's list to include Barry as he needs to send him the list and list updates.
A zone can be either a primary or secondary zone.
Note: Primary zones are now called master zones and secondary zones are now called slave zones.
The primary zone is the master record, and it is the one that gets changed by the administrator. To keep things simple only john can update the list. He has the master copy (primary zone). When he changes the list he needs to send a copy to Barry who has a copy (secondary zones or slave zones).
On DNS these changes are copied to the secondary zones in a process called zone transfer. Zone transfer is normally from primary to secondary, but it is requested by the DNS server responsible for the secondary zone.
In our explanation, Barry would request an updated list from John. However, the primary servers can be configured to notify secondary servers of changes. At it’s most basic a zone transfer is simply a file copy.
A DNS server hosting a primary zone is normally called a primary name server(master) ,and one hosting a secondary zone is a secondary name server (slave). A DNS server can store and manage multiple zone files, and they can be a mixture of primary and secondary zones.
In out analogy John could have a copy of TeamB list in case Fred goes on holiday. Therefore a DNS server can be both a primary and secondary name server. Primary and secondary name servers are both considered authoritative for a domain.
DNS Zones and Domains The use of zones and zone files is what allows DNS to be a distributed and resilient system. DNS Zones provide a very easy and simple method of grouping domain data from multiple domains together for storage. For domains to share a zone and hence a zone file the domains must be contiguous. A domain administrator would be responsible for creating zones, and delegating responsibility for these zones to an administrator and DNS server.
