DNS, which is called domain name system, I'm sure you have heard of DNS from many different people,
but what exactly is what's the purpose of DNS?
Well, Dennis, it is a system that is used to translate a hostname to IP address.
So what that means is when the whole Internet started, the websites that were built or when the systems
were built, computer systems were built, every computer system has an IP address.
And to remember those IP address was so cumbersome, people wouldn't remember the IP addresses they
were forgetting they would have to write it.
It's a security issue.
So then they came up with a resolution and the resolution was to come up with the names, the host names.
OK, we do have the hostname, but computers don't understand letters or horse named computers only
understand digits.
So how do we translate it?
We do need a system in place that does the translation for us.
And that system or that service is called DNS.
Again, domain name system.
It translate hostname to IP address, IP address to hostname, which is called a PTA record and hostname
to IP address.
The record name is called a record and the last function of DNS is translate hostname to hostname.
And this is for some of the hostname to translate to an easier like an alias type of hostname.
For example, Google have probably like 50 of servers running background that serves their website Google
dot com.
But do you think that Google itself is the name on every server is the same name?
No, it's not possible.
They probably have different names on those servers, but they do have one alias Google, which is pointing
to other server host names, and then it points to other servers.
That is when it's called hostname to hostname.
And in order to create that, you need to create a record.
And that record is called SI Name Record.
Please remember, this is a record Peter record and seen him record.
If you're going to be preparing yourself to go for a Linux interview, you will be asked these questions.
And I, I know that for sure.
Many people have been asked these questions to remember these records.
Then there are files that are involved in the configuration of DNS and the primary configuration file
is in ETSI.
As you already know, everyone should know that by now that ETSI is the configuration directory with
all the configuration of every service is located and and file name for DNS is called named dot com
name.
Dotcom is because named is the name of the process of the DNS and the package that you install for DNS.
It's called Binde.
Next Fi.
Next file we have is var name D.
This is not a file.
This directory in this directory you have all the zone files where you define all the hostname to IP,
IP to hostname and all the other stuff that you want to do, the service that you need to run in your
system or when you start it you have to run the command system.
Tems Ctrl Restart named name D is again name and D stands for Dayman.
So this Dayman it's going to run.
Keep running it.
Every time a request comes in, it's going to serve their request.
From this point on, we will go to the download, install and configuration of the DNS server.
So the first thing I would always recommend is that you create a snapshot of your virtual machine.
Whenever we touch the configuration file of a Linux machine, it is always a good idea to create a snapshot
just in case.
If you make a mistake in the configurations, you don't have to troubleshoot or spend endless number
of hours or even rebuild the entire Linux machine.
So please go ahead and create the snapshot.
Then the setup usually looks like, as in the DNS, there is a massive server and then there's a secondary
or slave server, which is a replication to the master server.
And then the client, the client is any machine that will resolve its hostname or other servers hostname
to IP addresses in our setup since we are using one Labbe machine.
We only have one the next machine.
We will use that one, the next machine as a master server and as a client as well.
We will not be setting up as a secondary or slave server.
But if you have two machines, then I would recommend that you set up the DNS on one machine and the
other machine uses as a client to look up for DNS entries.
Anyway, moving on are a domain name that we will set up for our lab.
DNS configuration is laberge local and the IP address that we will give to that DNS server is the local
IP address that will that is right now assigned to NPC S3.
So of course I'm sure everyone is using a Wi-Fi network adapter.
So in Wi-Fi network adapter, the IP address that is assigned it to your network or to your interface
is always a DCPI, meaning it changes every time you reboot.
So when you assign this IP address to your DNS, remember it could change sis better.
We will do the install configure DNS, but then we could actually undo all the changes or revert or
restore to original virtual machine snapshot any way the steps that will be involved would be is to
install the DNS package and the packages bind binded dash utils and my CI option, meaning say yes to
every question that will be asked.
Then we will do the configured DNS.
In summary, we will modify that ETSI named file.
We will create two zone files for the lab and first lab for the lab is to do hostname to IP address
look up and reverse is to do a reverse lookup which is IP to hostname lookup.
Then we will modify the DNS file permissions and start the service.
And of course after that, once you verify everything, DNS is working the way we wanted it to configure,
then I would definitely recommend that you report or restore back to your original snapshot.
So this way, if your IP changes, you don't have to go into the DNS configuration file and update that
IP over and over again.
This configuration of DNS works best if you have a static IP.
But since we are working on a wi fi DSP IP and this is a lab and my my intention here is to teach you
how you could download, install, configure and manage DNS.
And that's why we are going to this lab process.
So I will go into my Linux machine and first of all, I am here and I am logged in as myself, as sorry
as root.
And the IP address that I will use is 190 to 168 one 29.
I could do if config for that again to confirm one I to 160 168 one 29 is assigned to ENP zero is three.
Perfect.
I could do the installation configuration right here on the console, but I would prefer to use a putty
session.
So I already have a putty session open right here and I will minimize at this window the console and
I will use the putty machine again with the putty.
I will see who am I am my selfish directory I am in and which host I am an ok now I will become root.
OK, Laden, as ruthless do who am I root?
Let's clear the screen and now I will follow my detailed procedure that I have documented everything
in a word document, so I will open that up on the side.
So this way will follow the document step by step.
All the steps are excuse me, all the steps are are highlighted in step one, step two all the way,
I think, until step 13.
So first thing first, let's go ahead and do the install of the DNS package before we do install.
Let's check if we have that package to check it.
It's R.P.M. Desh Keyway and grab for bind.
It will go pull up all the list of our RPM's that we have installed and pacifically for bind.
Now look at the list and you will see there aren't any BINDE package installed just by itself.
Blinder's bind key bind aapc bind lib's license.
Leyb utils.
We do have utils.
That's good, but I will still go ahead and do an install on utils just in case there's a newer version.
If there is, it will upgrade this old version which is right here.
All right, so first step, install DNS youm install binde space binde does the second package u t s
minus y meaning just say yes to the question that will be asked during this install.
So when you do the jam, the jam will download as well as install your package or the package that you're
looking for.
All right, let's go ahead and hit enter.
Of course, this will go out and there were sent to US repositories, looks, it will look for these
packages.
So before it goes out to to repository and make sure you could actually get online, meaning get on
the Internet, you could just simply do Pangan dub, dub, dub dub, Google dot com.
And if you're getting a response, it means you are able to get online so that that's when you actually
that's when you actually go in and install the package.
And complete good now you could go ahead and do R.P.M., dash kuai and grab for Binde again and you
will see and you will verify that the Bine package just by itself binde had been installed beautiful
and as you told, package is there.
It was not 99 and now it has upgraded it to nine 11.
Perfect download installation is done.
Next part is actually configuring the DNS.
So when you install the BINDE or DNS, by the way, DNS is the name BINDE is the package name and the
service that runs the DNS runs.
It's called name D.
D stands for Dayman.
So remember the difference.
DNS is the name of the DNS is the name name of the entire DNS and the packaged application itself.
Binde is the package name and the service name is named.
All right, let's edit the ETSI name dot com file.
So before you edit it, you could make a copy as well if you're doing in production, but I'm sure you
have taken the snapshot.
So let's go and do V.I. ATSE named Horcoff.
Come down to the point where it says options, and here you have to do a lesson on Port 53, so by default,
the NSA listens on Port 53.
So right here, I want you to type in the IP address of the ENP zero S3, which is one eye to the 168
one dot.
I believe it is 29.
I will check again and put semicolon.
Please make sure.
And then there is a space.
Race is close and semicolon again.
Twenty nine now I want you to go down all the way down to the bottom of the file.
Right above where you see these two lines include you is going to you're going to see this the section
that is three, four lines of parameters.
It starts with Zone.
Now you have to.
Add in the value DOD, take that out and add lab dot local.
So this is the domain that I have picked to be the DNS domain type replace hint with master.
File.
The file name that we will create will be forward DOD lab.
And one last parameter would be allow Dasch update.
Space, curly braces, none.
Call semicolon space, curly braces.
Clothes and then semi called.
All right, then, next one is for our.
Reverse.
So for this, what I will do is I'll simply copy it from here.
OK, inserted.
All right, so now this is the reversal zone lock up configuration parameters, so in reverse, you
have to specify the the in the reverse order one 1A to 160 six one type is master file is reverse talab
allow update and let's close curly braces.
Did OK, included the last two lines, stays the same.
You don't have to change it, OK, just make sure this part.
Is added to your name, dot com file, exactly as I'm showing, all right, once it's added, by the
way, the the document that I have on my left hand side is also attached as part of this lecture.
You could download it and you could go through this exact same document.
All right.
Let's go ahead and save this file.
Phyla saved.
And quit now created two zone false, so one's own father be.
For the lab, but you have to go into bar named directory, make sure you are in war named directory
good.
Touch forward lab.
Touch reverse the lab.
We have both for forward and reverse now.
These are the zone files where we will actually going to keep the entries, the forward lookup entries
and reverse lookup entries.
So if you want to resolve hostname to IP, it will go into this file.
If you want to resolve IP to hostname, then it will go into this file.
All right.
Anyway, let's keep moving.
So now modify the first file, which is forward lab with Forward Lab.
This is the empty file.
Copy this.
Everything that I have in here.
And pasted.
In your file, so now let me just quickly tell you what this is format.
It's better that you format it the right way, not because it will be a bad configuration or won't work,
but it will be easier for you to read.
So I always do.
Tabs for days.
OK, so basically it's time to live.
Eighty six hundred eighty six thousand four hundred, every line that you see here has a meaning.
And of course if I go into every meaning, it will take a long time.
But just quickly, I'll tell you, every time you make a change to this file, the serial number has
to be updated.
So if you are adding an entry here, please make sure change one to two or three, adding the third
entry, make two to three.
All right.
So these are the predefined parameters that we have that we need to follow.
So let's come to DNS.
So massive defense.
So first of all, at in name server are Marsden's is Abda local and then add in a one to one sixty one
point twenty.
This is our IP address and our master Denisova is has the entry in a one three to one sixty one point
twenty nine.
These are the last two lines that I have added as a test client.
A in a one 100 to one sixty one to forty.
And the other one is.
By the way, these two machine clients and Client B do not exist, but I have just added just for testing
purposes whether I could resolve that when I completely done configuring the DNS.
All right.
So let's go ahead and save.
I is safe now.
Let's go ahead and modify the reverse stat lab.
And I'm going to do the same thing, I'm going to copy and paste exactly what I have here.
OK, everything is copied again, this one is reverse the first three entries.
Will be the same.
It has this client one, it shouldn't be there, but let me just remove this one.
Yes, I will remove this one here to.
OK, you saved the file.
OK, so it should have these first two as it was in the forward as well, then the third one mass audience
in a one I two one 68, one dud.
Twenty nine.
And if you notice these last three entries, we have the same entries in the forward, but they are
now reversed.
All right, good.
Now go ahead and save it.
Now we need to restart or start the service that associated with DNS, what that will do system we'll
start.
Named.
Perfected is started now let's enable it so it could start at Bhuti.
It's enabled, OK, the next part is.
Disable firewall, if you have a firewall running, go ahead and disable it and to disable the firewall
system, ctrl stop firewall de.
If you do not want to disable the firewall, then make sure you configure your firewall to allow 453
to come in and listen.
Unpure 53.
All right, let's disable it so it won't start back on Abbu time, it's disabled.
Now, let's go ahead and configure the permissions on war named for ownership and see Linux.
If you're running Linux and you have to run these commands, if you're not running Linux, then you
don't have to run the last two commands.
But anyway, still run it.
These this will set the permission of your war named for directory.
Make sure you run them in sequence.
So let's keep running ownership of this routine's as root, that's fine.
It didn't change.
It's still root.
If it was wasn't rude, then it would have changed it.
OK, and the last one is named Horcoff.
So everything is done now, test the configuration and zone files for any syntax error.
OK, so we have to make sure those configuration files, the changes we made to are actually has no
mistake.
So for that, the first configuration file changes we made was in at sea named dot com.
So to verify if there isn't any mistake in that configuration file will run the command named Dasch
checkoff etsi slash name dot com.
If you don't get any output, that means it has no issues or there isn't any mistakes in the configuration.
For now, I will do the same thing, but run a different command, which is check named Czech Zone,
and that is for my lab and lab forwards on file that we created.
And it says is own the lab local loaded serial numbers this and it says OK, meaning it works.
There is no mistakes perfect, are there, on the second command for a reverse zone and it says, OK,
beautiful, now we'll go into our network config files to add that DNS server information into that
network config file.
And as you know, our my neck is ENPI zero S3.
So if I do if config ENPI zero three, you're going to see sorry ENPI.
Zero three.
You're going to see that it has the IP address, the same IP address I have given to that DNS server,
so I will go into this configuration file.
ETSI says config network.
That's crept in there, there's a configuration file, V.I., I see if she ENP zero three.
I'll come all the way down and add the DNS entry would be DNS equal, 192 to 168, one point twenty
nine.
Save it now, we will have to modify the ETSI resolved oilcloth.
Now remember, if you are using two Linux machines and you are trying or configuring this DNS from on
one server and had the other server as a client, now it's time for you to go to Klein.
So can Klein can look it up to DNS?
If you only have one machine, that is fine.
We will keep or consider this one machine as a client as well as a server.
So for this modified the ETSI resolved koffel.
V.I. Azzi resolved Horcoff.
And here you will see the name server is set to your default gateway, which is one eye to 160 at one
point one, which is your modem, as well as in your home to replace.
One with 29, because this is now your new DNS server, it's safe.
Now it has saved.
Now let's go ahead and restart the service.
So we have to restart the network now.
System, ctrl, restart network.
Right, this network came back online, and now it's time to verify whether our configuration or the
other DNS works.
So we'll do Digg Master DNS, DOT Lab..
The local.
OK, so we will see right here.
Let me make this because it would be easier.
So right here, says Master.
DNS talab the local in a there is no IP is showing, hmm.
But let me try the NSA.
Look out for that and look up.
Master Dennis.
To the local, OK?
OK, it is OK, it's still going to one eight two, OK?
Yeah, because what happened is every time you restart the network, remember, we ran the Command Systems
Restart Network, it changes your DNS information back to one eight to one sixty one point one.
So go back into ETSI Resolve file and change it back to twenty nine.
Now try to dig master DNS, Dot LaBrot local, and here you're going to see Master DNS, the lab, the
local is actually resolving to one to one 68 one 29.
Beautiful.
OK, now try the next lookup command by the NSA to look up and the commands actually performs the same
function.
But Digg gives you more information than lookup.
OK, so now I'm going to do a..
Look up with Mass or DNS dolloped our local hit enter and now you will see it is going to the DNS server,
which we created one night to one 61 to 29.
And it is resolving itself and it is one eight to 161 that Toinette.
Awesome.
Now remember, we created two more entries in Forward Lookup Zone, and that was Clyde and Clyde B.
We're going to try to resolve that as well.
And let's look up client, a lab at our local.
And it's showing one eye to 168.
Tell Wanda 240 nice and let's do Clyde be.
One eye to one, sixty one to forty one, nice, so the forward look up works now let's try the reverse
lookup.
So instead of putting the hostname, let's put in the IP one iota 168 dot one dot two four zero.
And look at that.
It is resolving it to t hostname now.
Sameway will do for 241, and it is resolving for client B now if you build a new system and you wanted
to add a new entry to the DNS server, all you would have to do is to KDDI into OI named directory.
Then you will go into the.
Forward lab, you've modified that you come all the way down and for example, you type client see in.
A and then the new IP address of that to 42.
And make sure to update the serial number from one to two in this case, save it.
And then you could try.
To look it up.
Client, see?
Right now, it's not showing because we have to restart the named service, so that would be System
CTL restart.
Named.
Now, let's try and see and you can see that it is resolving to 242 now, see, that's how you keep
adding the host names and it will keep resolving it for you.
By the way, there is also a command to instead of restart named, you could you could reload the configuration
file.
But anyway, you can look that up.
So this is how you do the download installation and configuration of your DNS at this point, you should
know how to how it works.
If you want, you can revert back to your original snapshot or you could simply do system ctrl restart
network.
And what it will do is it will reset your ATC resolved file back to the original DNS one eight one sixty
one point one.
So you're now going to have a problem going to the Internet.
And when you do Penghu dot com, you're going to see it as able to pay.
Anyway, I hope this lecture serves as purpose.
You learned a lot from this lecture.
And if you have any any questions regarding DNS, please let me know.
It's just simple.
Just go through my documentation, the word document that I've attached and Kulluk.