Step-by-Step: Writing a Zone File
Updated: May 30, 2001


Note: This example is specific for using the GraniteCanyon.com free DNS service.  However, it can be adapted to work with any DNS service if you replace "ns1.granitecanyon.com" and "ns2.granitecanyon.com" in lines 1 and 2 with the names of the nameservers you are using.

For each domain you create, you need to have a zone file, which is basically a list of directions for where to send the web user. The three main types of requests from the user are:

HTTP - Web page requests.
FTP - FTP servers can be directed to the same or a different server than the web requests.
Mail - The email can be sent to the same or a different server than the web requests.

In your zone file, the IP number that you must enter is that of your DSL/Cable line (WAN) not the internal IP number of the server (LAN).  If your IP looks like 192.168.xxx.xxx, then you made a mistake and entered your internal LAN IP number.  You cannot reach internal LAN IP numbers from the Internet.  Be careful, this is one of the biggest mistakes with writing zone file.  Look here at this diagram if your are still confused.

Cut and past the text between the lines and use the "replace" function in either Notepad or Microsoft Word to do your replacements. It will save you time and be more accurate.

Replace yourdomain with your domain name
Replace xxx.xxx.xxx.xxx with your DSL/Cable IP number (WAN)
Replace yourname with your own name



yourdomain.com. IN NS ns1.granitecanyon.com.
yourdomain.com. IN NS ns2.granitecanyon.com.

yourdomain.com. IN RP yourname.yourdomain.com. yourdomain.com.

yourdomain.com. IN A xxx.xxx.xxx.xxx

www.yourdomain.com. IN CNAME yourdomain.com.
ftp.yourdomain.com. IN CNAME yourdomain.com.

localhost.yourdomain.com. IN A 127.0.0.1

yourdomain.com. IN MX 10 yourdomain.com.


The way this zone file is written, your domain name can be accessed from both "yourdomain.com" or "www.yourdomain.com" which is very convenient.
 



Step by Step Menu