How to install and configure BIND9 master & slave DNS on debian 12 step by step

Published: 02 April 2024
on channel: IT Skills 23
1,502
26

Title: How to Install and Configure BIND9 Master and Slave DNS Server on Debian 12

Description:

In this tutorial, we'll walk through the process of setting up a master-slave DNS server configuration using BIND9 on Debian 12. DNS (Domain Name System) is crucial for translating domain names into IP addresses, making it an essential component of network infrastructure.

In this step-by-step guide, you'll learn how to:

Install BIND9 on Debian 12.
Configure the master DNS server.
Configure the slave DNS server for zone transfers.
Test the DNS setup to ensure proper functionality.
Whether you're setting up a DNS server for a small home network or a large enterprise environment, this tutorial will provide you with the necessary knowledge to establish a reliable DNS infrastructure using BIND9 on Debian 12.


Settings:
Installing BIND9 on both master and slave servers:
apt-get -y install bind9 bind9utils bind9-doc

Check the version and status of the server:
named -v
sudo systemctl status named

Set the OPTIONS for IPv4:
nano /etc/default/named
options = " -u bind -4"

Edit the file "named.conf.options" for Master:
nano /etc/bind/named.conf.options
acl trusted {
192.168.178.100;
192.168.178.150;
192.168.178.0/24;
};

options {
directory "/var/cache/bind";
allow-query { any; };
allow-recursion { trusted; };
allow-transfer { none; };
listen-on port 53 { localhost; 192.168.178.100; };
forwarders { 8.8.8.8; 8.8.4.4; };
dnssec-validation auto;
listen-on-v6 { any; };
};

Edit the file "named.conf.local" for Master:
nano /etc/bind/named.conf.local

zone "itskills23.com" IN {
type master;
file "/etc/bind/forward.itskills23.com";
allow-notify { 192.168.178.150; };
};

zone " 178.168.192.in-addr.arpa " IN {
type master;
file "/etc/bind/reverse.itskills23.com";
allow-notify { 192.168.178.150; };
};

Create forward zone file for Master:
nano /etc/bind/forward.itskills23.com
$TTL 604800
@ IN SOA master.itskills23.com. root.master.itskills23.com. (
2024032600 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL


;DNS Server Record
@ IN NS master.itskills23.com.
@ IN NS slave.itskills23.com.
master IN A 192.168.178.10
slave IN A 192.168.178.20



;Application DNS Records
www IN A 192.168.178.160
mail IN A 192.168.178.170
ftp IN A 192.168.178.180

Check the zone file:
named-checkzone forward.itskills23.com /etc/bind/forward.itskills23.com
named-checkconf -z

Create reverse zone file for Master:
nano /etc/bind/reverse.itskills23.com

$TTL 604800
@ IN SOA master.itskills23.com. root.master.itskills23.com. (
2024032600 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL

;DNS Server Records
@ IN NS master.itskills23.com.
@ IN NS slave.itskills23.com.

;Reverse Lookup
100 IN PTR master.itskills23.com.
150 IN PTR slave.itskills23.com.

;Application PTR Records
160 IN PTR www.itskills23.com.
170 IN PTR mail.itskills23.com.
180 IN PTR ftp.itskills23.com.

Check the zone file for error:
sudo named-checkzone reverse.itskills23.com /etc/bind/reverse.itskills23.com

Restart bind:
systemctl restart named
systemctl status named

Change DNS IP:
nano /etc/netwok/interfaces
nano /etc/resolv.conf

Test:
dig master.itskills23.com
dig www.itskills23.com
dig ftp.itskills23.com


#itskills23 #dns #bind9
Don't forget to like, share, and subscribe for more tutorials on networking and server administration!


Watch video How to install and configure BIND9 master & slave DNS on debian 12 step by step online without registration, duration hours minute second in high quality. This video was added by user IT Skills 23 02 April 2024, don't forget to share it with your friends and acquaintances, it has been viewed on our site 1,502 once and liked it 26 people.