0:00
hello everyone welcome back to our
0:02
channel in today's tutorial we will
0:04
cover how to set up a DNS server using
0:09
24.4 D server plays a crucial role in
0:12
translating domain names into the IP
0:14
address and vice versa and making it
0:17
easier to access websites if you are
0:19
working on a local network or looking to
0:21
host your own DNS then this is the guide
0:24
for you let's dive in and get started
0:27
before we begin let's talk about what B9
0:29
is is it is one of the most widely used
0:32
DNS server applications especially
0:34
popular in Linux environments by
0:37
configuring b n we can manage domain
0:39
name resolution within the network or
0:42
even host your own domains in this
0:44
tutorial I'll be using the followings so
0:47
this is my22 24.4 system where I will be
0:51
installing the bind 9 in order to
0:53
configure the DNS server this is the IP
0:55
address of my system and this will be
0:58
the domain name that I will be using it
1:01
while installing and configuring the DNS
1:03
server and this is the private Network
1:05
on this private Network I have these two
1:07
client machines these client machines
1:09
will be using this DNS server without
1:12
any further delay let's get
1:15
started in the interest of time I have
1:18
already prepared a set of instructions
1:20
and the sample file that I will refer in
1:22
this tutorial I will paste these in the
1:25
description of the video for your
1:28
reference the the first step is to
1:30
update system packages in order to
1:33
install all the available updates on
1:36
your system first we need to run the app
1:38
update and app upgrade
1:41
command I have only taken the SSS
1:46
24.4 system let's start updating the
1:52
packages me clear the
2:12
next install the bind n package along
2:14
with the additional utilities for the
2:16
configuration for that we'll be running
2:19
this command copy this
2:39
once all the packages have been
2:41
installed we will move into the
2:42
configuration part all the configuration
2:44
files for the bind are located in the
2:46
folder SL cc/ bind one of the important
2:50
configuration file for the bind is
3:03
in this file we will Define our private
3:05
Network and we will allow that private
3:08
Network to query to this DNS server
3:10
apart from this we will add the
3:11
forwarders DNS server this will come
3:14
into the picture whenever our local DNS
3:16
server is unable to resolve any query in
3:19
that case local DNS server will forward
3:21
that request to this forwarder genus
3:24
right let's edit this file
3:32
I'll be using the sample file that I
3:34
have already prepared it copy these
3:41
lines I will delete these
3:49
lines and paste the one that I copied
3:52
from the sample this is my private
3:54
Network under allow query I have allowed
3:57
this ACL internal hyper Network work in
4:00
the forwarders I have specified the
4:05
server all right now save this
4:10
file next important configuration file
4:13
is name.on dolal in this file we will
4:17
Define the Jones for our domain there
4:19
are two type of Zone files reverse Zone
4:22
and the forward Zone in the forward Zone
4:24
files we'll Define the records like NS a
4:28
MX and C name and reverse Zone files we
4:33
usually Define the PTR
4:35
CS all right let's edit this
4:47
file again I will use my sample file so
5:03
so under the Zone section I have defined
5:06
this is my domain name for this domain
5:09
this is my forwarders Zone file with the
5:12
name forward. linux.org similarly for
5:15
the reverse Zone we need to Define this
5:17
syntax so in make sure you replace the
5:20
domain name and this uh private Network
5:23
according to your setup and this is my
5:34
file sample Zone files are already
5:37
located under the EDC bind folder for
5:40
forward Zone you can refer this one and
5:43
for the reverse Zone you can refer this
5:46
file next create our forward Zone
5:54
file copy the content from our sample
6:09
this is the NS record which explain
6:12
about the fqdn for our DNS server in our
6:15
case the fqdn for our name server is
6:18
primary. linux.org and I have defined
6:21
the aord this a record points to our ubu
6:26
system I have also defined m MX record
6:30
MX record is used for the mail servers
6:32
so this is keyword MX is your type of
6:35
record 10 is the priority for this
6:37
report it could be a scenario that you
6:41
multiple u m servers in that case we
6:44
this priority come into the picture and
6:46
this is the fqdn of my mail server
6:49
similarly for www uh I am running uh a
6:54
web server on this IP and mail server is
7:00
and in the last I had defined a c name
7:05
file next create a reverse Zone
7:14
file copy the content from the sample
7:25
file in this file we we have PTR course
7:29
p course means it will DNS will resolve
7:32
the IP address into the
7:36
fqdn this is for my name server 50 is
7:40
for my web server and 60 will resolve
7:53
file next uh edit EDC default named file
7:57
we need to add one parameter so that DNS
8:00
service start listening on
8:13
ipv4 in order to implement these changes
8:16
we need to restart our bind service that
8:18
is name d for that run the command sudu
8:30
enable the service so that it is
8:32
persistent across the
8:37
reboot now verify the
8:44
status output confirms that named the
8:46
service is up and running in case OS
8:49
firewall is running on your system then
8:51
you need to allow the DNS board that is
8:54
53 for that you can in the command to do
9:01
let me clear the screen
9:10
first there are some utilities that can
9:12
cross verify the syntax of your con file
9:18
files you want to verify the syntax of
9:21
your con file in that case you can run
9:24
this command Soo space named hyphen
9:26
check conf and the con file that you
9:39
this if there is no output it means the
9:42
syntax wise the file is okay similarly
9:46
you can cross verify your Jone
9:51
files for Jone file there is a utility
9:54
called named Pyon check John
10:02
here okay means syntax wise this file is
10:06
perfect similarly to the validation for
10:18
file now our DNS server installation and
10:21
configuration part is completed next
10:24
validate this uh DNS server for that we
10:27
will be moving to the client machine
10:29
machine we'll update the DNS server on
10:32
that machine and we'll run couple of
10:37
cases all right first we need to make
10:39
sure in the res.com file our DNS server
10:43
is specified there can cross
10:51
verify I have already updated this file
10:57
server all right now we have a utility
11:01
called dig that can query to our DNS
11:04
server let's try to run the command
11:08
dig and then the fqdn of our name
11:22
great we are getting the answer from
11:26
this name server let's do a PT a record
11:30
validation for that you can
11:34
use dig hyon X and then the IP address
11:47
server great this is pointing to this
11:51
fqdn means PT code is also working fine
11:56
and let's look up let's say I want to
11:59
have the record of my web server
12:07
for this fqdn ww linux.org this is the
12:12
of web server similarly we can cross
12:16
verify the record for our mail server
12:32
that's all from this video tutorial I
12:34
hope you have found it useful and
12:36
informative please do like the video
12:38
subscribe to our channel for more Tech
12:40
tutorials like this feel free to post
12:43
your queries and feedback in the below
12:45
comment section see you in the next