Setting up a simple linux DNS server

yum install bind
service named start

sample zone file is shown below. This must be located in /etc/named

$TTL 3600        ; 1 hour default TTL
mydomain.com.    IN      SOA      ns1.mydomain.com. admin.mydomain.com. (
                                2006051501      ; Serial
                                10800           ; Refresh
                                600             ; Retry
                                604800          ; Expire
                                300             ; Negative Response TTL
                        )

; DNS Servers
                IN      NS      ns1.mydomain.com.
                IN      NS      ns2.mydomain.com.

; MX Records
                IN      MX 10   mx.mydomain.com.
                IN      MX 20   mail.mydomain.com.

                IN      A       192.168.56.107

; Machine Names
localhost       IN      A       127.0.0.1
ns1             IN      A       192.168.1.2
ns2             IN      A       192.168.1.3
mx              IN      A       192.168.1.4
mail            IN      A       192.168.1.5
mail            IN      A       192.168.1.70

; Aliases
www             IN      CNAME   mydomain.com.
[root@centos1 etc]#

Add the following to /etc/named.conf

zone "mydomain.com" {
        type master;
        file "/etc/named/my.zone";
};

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.