Domain Name System

AÏMEN HAJRI

BILEL SASSI

CONTENTS

I-INTRODUCTION

II-Configure Cache NameServer

III-Test the Cache NameServer

IV-Configure Primary/Master Nameserver

V-Build the Forward Resolution for Primary/Master NameServer

V-Build the Reverse Resolution for Primary/Master NameServer

VI-Test the DNS server

 

 

DNS is an internet service that maps IP addresses to fully qualified domain names (FQDN) and vice versa.

BIND is the most common program used for maintaining a name server on Linux.

BIND stands for Berkley Internet Naming Daemon.

INTRODUCTION

Configure Cache NameServer

The job of a DNS caching server is to query other DNS servers and cache the response. Next time when the same query is given, it will provide the response from the cache. The cache will be updated periodically.

/etc/bind/named.conf.options 

forwarders {
    8.8.8.8;
    8.8.4.4;
};
$ sudo service bind9 restart

Test the Cache NameServer

$ dig ubuntu.com

;; Query time: 1323 msec
$ dig ubuntu.com

;; Query time: 3 msec

Configure Primary/Master Nameserver

 /etc/bind9/named.conf.local.

zone "thegeekstuff.net" {
    type master;
    file "/etc/bind/db.thegeekstuff.net";
};
zone "0.42.10.in-addr.arpa" {
        type master;
        notify no;
        file "/etc/bind/db.10";
};

Build the Forward Resolution for Primary/Master NameServer

$ sudo cp /etc/bind/db.local /etc/bind/db.thegeekstuff.net
$TTL    604800
@   IN  SOA ns.thegeekstuff.net. lak.localhost. (
             1024       ; Serial
             604800     ; Refresh
              86400     ; Retry
            2419200     ; Expire
             604800 )   ; Negative Cache TTL
;
@   IN  NS  ns.thegeekstuff.net.
thegeekstuff.net.    IN      MX      10      mail.thegeekstuff.net.
ns  IN  A   10.42.0.83
web IN  A   10.42.0.80
mail IN A   10.42.0.70
$ sudo cp /etc/bind/db.127 /etc/bind/db.10
$TTL    604800
@   IN  SOA ns.thegeekstuff.net. root.localhost. (
             20         ; Serial
             604800     ; Refresh
              86400     ; Retry
            2419200     ; Expire
             604800 )   ; Negative Cache TTL
;
@   IN  NS  ns.

Build the Reverse Resolution for Primary/Master NameServer

Next, for each A record in :

 

/etc/bind/db.thegeekstuff.net, add a PTR record.

$TTL    604800
@   IN  SOA ns.thegeekstuff.net. root.thegeekstuff.net. (
             20     ; Serial
             604800     ; Refresh
              86400     ; Retry
            2419200     ; Expire
             604800 )   ; Negative Cache TTL
;
@    IN  NS  ns.
83   IN  PTR ns.thegeekstuff.net.
70   IN  PTR mail.thegeekstuff.net.
80   IN  PTR web.thegeekstuff.net.

Test the DNS server

add the following to /etc/resolv.conf

nameserver 10.42.0.83
$ ping mail.thegeekstuff.net

PING mail.thegeekstuff.net (10.42.0.70) 56(84) bytes of data.
64 bytes from mail.thegeekstuff.net (10.42.0.70): icmp_req=1 ttl=64 time=0.482 ms
64 bytes from mail.thegeekstuff.net (10.42.0.70): icmp_req=2 ttl=64 time=0.532 ms

  THANK YOU 

FOR

    YOUR ATTENTION

Dom

By Aimen Hajri