Setup local DNS server, Bind9 on Linux

How to configure Bind 9 as private local DNS

We are going to install local DNS server on the Ubuntu server by using open source DNS tool Bing9.

First we need to install bind9 on the Ubuntu:

sudo apt install bind9 bind9-utils bind9-dnsutils -y

Second go to named.conf.local file under /etc/bind, and add below:

//
// Do any local configuration here
//
// Consider adding the 1918 zones here, if they are not used in your
// organization
//include "/etc/bind/zones.rfc1918";

zone    "example.com"  {
        type master;
        file "/etc/bind/db.forward.com";
};

zone    "100.10.10.in-addr.arpa" {
        type master;
        file "/etc/bind/db.reverse.com";
};

Then we are going to copy default conf files with command cp db.local to db.forward.com and cp db.127 to db.reverse.com. when it’s done update below conf files:

// db.forward.com
; BIND data file for local loopback interface
;
$TTL    604800
@       IN      SOA     ns.dnsserver.com. root.localhost. (
                              2         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800 )       ; Negative Cache TTL
;
        IN      A       10.10.100.13
@       IN      NS      ns.dnsserver.com.
ns      IN      A       10.10.100.13
server  IN      A       10.10.100.13


//db.reverse.com
;
; BIND reverse data file for local loopback interface
;
$TTL    604800
@       IN      SOA     ns.dnsserver.com. root.localhost. (
                              1         ; Serial
                         604800         ; Refresh
                          86400         ; Retry
                        2419200         ; Expire
                         604800 )       ; Negative Cache TTL
;
@       IN      NS      ns.
13      IN      PTR     ns.dnsserver.com.
13      IN      PTR     server.dnsserver.com.

Please check out here for more details regarding Bind9 : BIND 9 – ISC

Leave a Reply

Э-пошта мекенжайыңыз жарияланбайды. Міндетті өрістер * таңбаланған