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

Опубликовано: 30 Октябрь 2022
на канале: The Lazy SysAdmin
5k
72

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

Join this channel to get access to perks:

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

PLEASE SUBSCRIBE :)
PLEASE HIT LIKE IF IT HELPED :)

GIVE SUPPORT -
BUY ME A COFFEE -
PAYPAL -

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.

LINKS:
Install AlmaLinux 9 -

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!


Смотрите видео Install and Configure BIND 9 Master and Slave DNS Server for Local Network using AlmaLinux 9 онлайн без регистрации, длительностью 09 минут 23 секунд в хорошем hd качестве. Это видео добавил пользователь The Lazy SysAdmin 30 Октябрь 2022, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 5 тысяч раз и оно понравилось 72 людям.