Building a simple Domain Name Server (DNS) (Centos63)

These are my notes for building a very basic DNS server using Centos 6.3.

Here we are using as a DNS server to allow our other CentOS servers to get IP’s without having to administer the /etc/hosts files on each server. This is a virtual server running in VirtualBox on my Macbook Air

yum -y install bind bind-utils
service named start

vi /etc/named.conf…

// named.conf
// Provided by Red Hat bind package to configure the ISC BIND named(8) DNS
// server as a caching only nameserver (as a localhost DNS resolver only).
// See /usr/share/doc/bind*/sample/ for example named configuration files.
options {
        //listen-on port 53 {; };
        //listen-on-v6 port 53 { ::1; };
        directory       "/var/named";
        dump-file       "/var/named/data/cache_dump.db";
        statistics-file "/var/named/data/named_stats.txt";
        memstatistics-file "/var/named/data/named_mem_stats.txt";
        //allow-query     { localhost; };
        recursion yes;
        dnssec-enable yes;
        dnssec-validation yes;
        dnssec-lookaside auto;
        /* Path to ISC DLV key */
        bindkeys-file "/etc/named.iscdlv.key";
        managed-keys-directory "/var/named/dynamic";
logging {
        channel default_debug {
                file "data/";
                severity dynamic;
zone "." IN {
        type hint;
        file "";
zone "" {
        type master;
        file "";
zone "" {
        type master;
        file "";
include "/etc/named.rfc1912.zones";
include "/etc/named.root.key";

vi /var/named/

@       IN      SOA (12 4h 1h 1w 1h)
@       IN      NS
centos63-004                            IN      A
centos63-005                            IN      A
www                                     IN      A
centos63-006                            IN      A
centos63-007                            IN      A

vi /var/named/

@      SOA (12 4h 1h 1w 1h)
@      IN      NS
24     IN      PTR
22     IN      PTR
23     IN      PTR
25     IN      PTR
27     IN      PTR
service named restart
chkconfig named on

Now just change each nodes’ /etc/resolv.conf to

Categorized as FAQs, Linux

By troyski

I'm a freelance UNIX engineer working in the UK. I'm married to Tina and between us we have six children. I'm a bit of an Apple fan boy, and all the Windows machines in the house are a thing of the past now.

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