Sample DNS Zone File for BIND

Sample Zone file for a domain with 2 nameservers ns1.example.com and ns2.example.com for BIND9. You can use this template to define your own nameservers. Just do changes on the domain name and IP addresses.

Be sure to include the below statement in your named.conf
I am assuming that you are running Bind9 or later version in your VPS or dedicated server.

zone "example.com" {
type master;
file "example.com.db";
}

$TTL 14400
$ORIGIN example.com.

; Specify the primary nameserver ns1.example.com in SOA
@ 14400 IN SOA ns1.example.com. webmaster.example.com. (
                                2008092902 ; Serial in YYYYMMDDXX (XX is increment)
                                10800; refresh seconds
                                3600; retry
                                604800; expire
                                38400; minimum
                                );
; Website IP Address specified in A record

       IN A 11.11.11.11

; TWO nameserver names

       IN NS ns1.example.com.
       IN NS ns2.example.com.

; Nameservers and their corresponding IPs

ns1  IN A 11.11.11.11
ns2  IN A 22.22.22.22

; Specify here any Aliases using CNAME record

www IN CNAME example.com.
ftp IN CNAME example.com.

; Set Mail Exchanger record with priority

mail IN MX 10 example.com.

How to test the DNS server?

Just goto the following sites, enter the domain name and you will see the test results.

http://www.intodns.com (free)
http://www.pingability.com (free)
http://www.dnsstuff.com (paid)

Good luck!

Similar Posts:

Tags:

Balakrishnan Prabhu

Mr. Balakrishnan Prabhu is the founder of Corpocrat magazine. He is also the founder of Best Citizenships (BC), assisting wealthy individuals with with global citizenship and residency programs in Europe. His other interests are Linux, Machine learning, Wordpress, etc. You can contact him here

  • Alex

    Hi,

    I have registerd private nameservers in my dedicated server for firstdomain.com and want to host a second domain at the same server. I went to godaddy.com and put the same nameservers for the firstdomain.com into second domain’s nameservers info. Now for nslookup seconddomain.com I get servfail response.

    How the conf files in my dedicated server must be modified to host multiple domains using private nameservers for one domain?

    Thanks.
    Alex.

  • Another free solution is http://www.zonefile.org

  • Jerome

    I’m really enjoying the theme/design of your web site. Do you ever run into any web browser compatibility issues? A few of my blog visitors have complained about my website not working correctly in Explorer but looks great in Opera. Do you have any tips to help fix this issue?