2019/07/19

BIND9 DNS Server setup at Ubuntu

Today, I'm going to build DNS service using BIND9 at Ubuntu.



As you know, BIND9 is so famous DNS service daemon.

and It also famous it's strict grammer. sometimes disgusting to setup.



First of all setup service.

#apt-get install bind9



Files to setup is on "/etc, /etc/bind/" directory.



[hosts]==================================================================================

192.168.0.60 webextest.com apple          # Host server IP address, domain, name



[resolv.conf]=============================================================================

nameserver 192.168.0.60          # Name server's IP address



[named.conf]=============================================================================

zone "webextest.com" {          # Inverse zone domain

 type master;

 file "/etc/bind/webextest.zone";          # File name is anything good.

};



zone "0.168.192.in-addr.arpa" {          # Reverse zone domain(192.168.0 input reverse)

 type master;

 file "/etc/bind/webextest.rev";          # File name is anything good.



};



[inverse zone]===========================================================================

$TTL 604800

@ IN SOA webextest.com. root.webextest.com. (          # End of the domain, you MUST input "."

      1111  ; Serial          # Input the number not duplicate.

    604800  ; Refresh

     86400  ; Retry

   2419200  ; Expire

    604800 ) ; Negative Cache TTL

;

@ IN NS webextest.com.          # Domain name

@ IN A 192.168.0.60          # Host server address



www IN A 192.168.0.60          # Web server address



[reverse zone]===========================================================================

$TTL 604800

@ IN SOA webextest.com. root.webextest.com. (          # End of the domain, you MUST input "."

      2222  ; Serial          # Input the number not duplicate.

    604800  ; Refresh

     86400  ; Retry

   2419200  ; Expire

    604800 ) ; Negative Cache TTL

;

@ IN NS webextest.com.          # Domain name

@ IN A 192.168.0.60          # Host server address



60 IN PTR webextest.com.          # input last octet of IP address



========================================================================================



After setup, restart service.

#service bind9 restart



now, check the DNS service.

#nslookup webextest.com
#nslookup 192.168.0.60



and then, check the zone file

#named-checkzone webextest.com webextest.zone

If grammer is correct, you can see OK sign.



Example file is here. refer to this example files.

BIND9 Setup.zip
BIND9 Setup 2.zip



It looks like simple, but It's too strict to setup.

maybe you will meet error message at least one time.



Good luck!

No comments:

Post a Comment