DNS Server linuxLinux serverNETWORK ADMINISTRATIONS

Install and Configure BIND 9 Master and Slave DNS Server for Local Network using AlmaLinux 9 – 2023

In this video, I will show you how I installed and configured a DNS server for my local network.

The DNS server that I installed is the de-facto standard Bind 9.

PLEASE SUBSCRIBE 🙂
PLEASE HIT LIKE IF IT HELPED 🙂

I also setup two DNS servers as master and slave.
I have setup this as an authoritative for my local domain lazy.test and as recursive DNS server as well.

GIVE SUPPORT – https://www.patreon.com/lazysysad
BUY ME A COFFEE – https://www.buymeacoffee.com/lazysysad
PAYPAL – https://www.paypal.com/donate/?hosted_button_id=K4RQ3LAWHGVS6

LINKS:
Install AlmaLinux 9 – https://youtu.be/eGvDIAX-iek

Commands and Configuration:
Domain: lazy.test
Master DNS IP: 192.168.0.10
Slave DNS IP: 192.168.0.11

Primary DNS
sudo dnf -y update
sudo dnf install -y bind bind-utils
sudo systemctl enable named –now
sudo systemctl status named
sudo vi /etc/named.conf
listen-on port 53 { localnets;};
allow-query { localhost; 192.168.0.0/24; };
allow-transfer {192.168.0.11/32;};

sudo vi /etc/named.rfc1912.zones
zone “lazy.test” {
type master;
file “/var/named/forward.lazy.test”;
allow-update { none; };
};
zone “0.168.192.in-addr.arpa” {
type master;
file “/var/named/reverse.lazy.test”;
allow-update { none; };
};

sudo named-checkconf
sudo vi /var/named/forward.lazy.test
$TTL 604800
@ IN SOA ns1.lazy.test. root.lazy.test (

2022102901 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
604800 ) ; Negative Cache TTL

@ IN NS ns1.lazy.test.
@ IN NS ns2.lazy.test.
ns1 IN A 192.168.0.10
ns2 IN A 192.168.0.11

sudo vi /var/named/reverse.lazy.test
$TTL 604800
@ IN SOA ns1.lazy.test. root.lazy.test. (
2022102901
604800
86400
2419200
604800 )

@ IN NS ns1.lazy.test.
@ IN NS ns2.lazy.test.
10 IN PTR ns1.lazy.test.
11 IN PTR ns2.lazy.test.

sudo named-checkzone forward.lazy /var/named/forward.lazy.test
sudo named-checkzone reverse.lazy /var/named/reverse.lazy.test
sudo systemctl restart named
sudo firewall-cmd –permanent –add-port=53/tcp
sudo firewall-cmd –permanent –add-port=53/udp
sudo firewall-cmd –reload

Secondary DNS:
sudo dnf -y update
sudo dnf install -y bind bind-utils
sudo systemctl enable named –now
sudo systemctl status named
sudo vi /etc/named.conf
listen-on port 53 { localnets;};
allow-query { localnets; };

sudo vi /etc/named.rfc1912.zones
zone “lazy.test” {
type slave;
file “/var/named/slaves/forward.lazy.test”;
masters { 192.168.0.10; };
};

zone “0.168.192.in-addr.arpa” {
type slave;
file “/var/named/slaves/reverse.lazy.test”;
masters { 192.168.0.10; };
};

sudo named-checkconf
sudo systemctl restart named
sudo ls -l /var/named/slaves/
sudo firewall-cmd –permanent –add-port=53/tcp
sudo firewall-cmd –permanent –add-port=53/udp
sudo firewall-cmd –reload
sudo vi /etc/resolv.conf
nameserver 192.168.0.10
nameserver 192.168.0.11

nslookup ns1.lazy.test
nslookup ns2.lazy.test

Chapters:
00:00 Intro
00:53 Primary DNS – Update Server
01:04 Primary DNS – Install BIND 9
01:22 Primary DNS – Configuration
03:07 Primary DNS – Forward Lookup Zone File
03:29 Primary DNS – Reverse Lookup Zone File
04:11 Primary DNS – Firewall
04:29 Secondary DNS – Update Server
04:51 Secondary DNS – Install BIND 9
05:04 Secondary DNS – Configuration
06:42 Secondary DNS – Firewall
07:00 Verification
08:21 Configure Client DNS
09:07 Outro

Please enjoy the video and if you have any questions, leave a comment down below.

Remember to Like, Share and Subscribe if you enjoyed the video!

#almalinux
#dns
#bind9
#thelazysysadmin

source

by The Lazy SysAdmin

linux dns server

5 thoughts on “Install and Configure BIND 9 Master and Slave DNS Server for Local Network using AlmaLinux 9 – 2023

  • Thank you so much, its very clear and well explained ! Love it !

  • Can you create a video on LDAP? Looking into an alternative to AD. Salamat!

  • Well those are local netowrk ip's. But how you would setup 2 nameservers (master+slave) in real world with 2 different public ip's. You cannot create 2 nameservers for 1 public ip.

  • Very nice and concise, this has been an invaluable resource for me. Thank you for the video!

Comments are closed.