OK, here is a zone file we have opened up in notepad. Move the mouse over the different parts of the zone and look at the descriptions near the bottom of the page to get an explanation of what they do. In the example below for mydomain.com, email servers are mail.mydomain.com, mail2.mydomain.com and mail.anotherhost.com. It has host records for www.mydomain.com, router.mydomain.com (it points to a private IP, but that is OK and can be very useful for your own internal networks), proxy.mydomain.com, and several others including A records for the mail servers mail and mail2. This is typical of a zone file used by our DNS Services.
A zone should
contain one NS-record for each of its own DNS servers (primary and secondaries).
This mostly is used for zone transfer purposes (notify). These NS-records
have the same name as the zone in which they are located.
The most important function of the NS-record is delegation. Delegation means that part of a domain is delegated to other DNS servers. For example all ".com" sub-names (such as "microtech.com") are delegated from the "com" zone (hosted by the "InterNic"). The "com" zone contains NS-records for all ".com" sub-names (a lot!).
You can also delegate sub-names of your own domain name (such as "subname.yourname.com") to other DNS servers. You are in effect the "InterNic" for all sub-names of your own domain name
To delegate "subname.yourname.com", create NS-records for "subname.yourname.com" in the "yourname.com" zone. These NS-records must point to the DNS server responsible for "subname.yourname.com" for example "ns1.subname.yourname.com" - or a DNS server somewhere else like "ns1.othername.net".
An NS-record
identifies the name of a DNS server - not the IP-address.
Because of this, it is important that an A-record for the referenced DNS
server exists (not necessarily on your server, but wherever it belongs),
otherwise there may not be any way to find that DNS server and communicate
with it.
TTL
All dns records have a TTL (Time-To-Live) whether it is specifically listed
or not. This TTL tells other systems how long they can cache your record
for. Most DNS servers use TTL's of a couple of days. This is why it sometimes
takes a long time for changes your ISP made to take effect. If you set the
TTL to low it will result in a large number of queries as computers will
have to constantly check the server to get the IP address. If you set it
to high and you make frequent changes, it might take a long time for these
changes to propagate out onto the web.
TTL's are stated in seconds. We don't allow TTL's les than 60 seconds.
Often computers on the Internet have multiple functions such as web-server, ftp-server, chat-server etc.
To mask this,
CNAME-records can be used to give a single computer multiple names (aliases).
For example computer "www.mycomputer.com" may be both a web-server
and an ftp-server, so two CNAME-records are defined:
"www.mycomputer.com" = "xyz.com" and "ftp.mycomputer.com"
= "xyz.com".
Sometimes a single server computer hosts many different domain names such as web servers that host many sites. In this example many CNAME records may be defined such as "www.abc.com" = "www.xyz.com".
The most popular
use the CNAME-record type is to provide access to a web-server using both
the standard "www.domain.com" and "domain.com" (without
the www).
This is usually done by creating an A-record for the short name (without
www), and a CNAME-record for the www name pointing to the short name.
CNAME-records can also be used when a computer or service needs to be renamed, to temporarily allow access through both the old and new name.
A CNAME-record should always point to an A-record to avoid circular references.
When sending an e-mail to "user@xyz.com", your mail server must first look up the MX-record for "xyz.com" to see which mail server actually handles mail for "xyz.com" (this could be "mail.xyz.com" - or someone else's mail server like "mail.isp.com"). Then it looks up the A-record for the mail server to connect to its IP-address.
An MX-record has a "Preference" number indicating the order in which the mail server should be used (Only relevant when multiple MX-records are defined for the same domain name). Mail servers will attempt to deliver mail to the server with the lowest preference number first, and if unsuccessful continue with the next lowest and so on.
An MX-record identifies the name of a mail server server - not the IP-address. Because of this, it is important that an A-record for the referenced mail server exists (not necessarily on your server, but wherever it belongs), otherwise there may not be any way to find that mail server and communicate with it.
Do not point an MX record to a CNAME-record. Many e-mail servers don't handle this. Add another A-record instead.
As per the example above. Sometimes you'll get someone else to act as a backup for your mailserver (as with our backup mail server service) in case yours is unreachable for any reason. If you include a name outside of your own domain, enter it in full and end it with a '.'
A Records
They are used to translate human friendly domain names such as "www.mtgsy.net"
into IP-addresses such as 212.30.15.86 (machine friendly numbers) and map
IP addresses directly to hostnames. As you can see from the above example.
If you wanted a host in this zonefile called www (for www.yourserver.com),
you add it to the zone file as shown here. When managing your DNS file using
our web based management the A record wizard quickly adds/changes/removes
A records for you.