Name Resolution Commands (Demo)

Video Activity
Join over 3 million cybersecurity professionals advancing their career
Sign up with
Required fields are marked with an *
or

Already have an account? Sign In »

Time
21 hours 25 minutes
Difficulty
Intermediate
CEU/CPE
21
Video Transcription
00:00
>> Hello, Cybrarians.
00:00
Welcome back to the Linux+ Course here at Cybrary.
00:00
I'm your instructor Rob Goelz.
00:00
In today's lesson,
00:00
we're going to be discussing name resolution commands.
00:00
These are the commands that we're going to
00:00
use to work with name resolution.
00:00
We saw the configuration files in the last lesson,
00:00
now we're going to use the commands.
00:00
Upon completion of the lesson today,
00:00
you'll be able to use the dig command.
00:00
We're going to understand how to use nslookup,
00:00
as well as host,
00:00
all of which can help us with that name resolution.
00:00
Let's find some hosts and move
00:00
over and do some demo time.
00:00
In today's demo, we're going to work
00:00
exclusively in CentOS,
00:00
and today we're going to start with the dig command.
00:00
Now, the dig command is one of
00:00
three commands for name resolution,
00:00
and the dig command is very useful because you can
00:00
specify the type of DNS record that you're looking for.
00:00
We can just run dig with
00:00
www.google.com and it will
00:00
return good information for us.
00:00
It's going to give us the A record,
00:00
which is the address mapping,
00:00
that's the most common type of DNS record.
00:00
That's basically the IP address
00:00
to the host name and we can see right here,
00:00
www.google.com with IP address 142.250.73.196.
00:00
But we can also tell it that we want to, say,
00:00
find information about the mail exchanger,
00:00
the e-mail servers that are out there in the domain.
00:00
Let's say that we want to find
00:00
the mail exchange for www.google.com,
00:00
that's on the google.com domain,
00:00
and then we can specify that we want to know the
00:00
MX, mail exchanger record.
00:00
If you type "MX",
00:00
hit "Enter", and what that's going to do,
00:00
it's going to give us a list,
00:00
an answer session with
00:00
all the mail exchanges that
00:00
are out there that are being used.
00:00
Then it will also give us the A addresses
00:00
that are associated with those mail exchangers.
00:00
Well, we were looking at name servers
00:00
in the previous lesson,
00:00
in other words, DNS servers,
00:00
we can do the same thing here.
00:00
We can find out what the name servers are out
00:00
there by using NS option,
00:00
that's NS for name server.
00:00
If we hit "Enter" here,
00:00
it's going to give us all the name servers
00:00
that are used at Google,
00:00
and so we can see the actual name servers,
00:00
what they are, and we can see
00:00
the A records for those name servers.
00:00
In other words, the IP addresses associated with
00:00
those name servers on the google.com domain.
00:00
That's pretty much what you need to know for dig.
00:00
Let's go ahead and move on to our next command,
00:00
which is the nslookup command.
00:00
The nslookup command can provide
00:00
host name to IP address resolution,
00:00
but it can also do the reverse,
00:00
providing the IP to the host name, so host-named IP.
00:00
Let's just do this first. Let's do nslookup,
00:00
dns.google.com.
00:00
Then we've got the nslookup here coming back
00:00
with 8.8.4.4, 8.8.8.8.
00:00
What we can do now is we can actually give
00:00
an nslookup one of those IP addresses.
00:00
Let's do nslookup 8.8.8.8 and hit "Enter",
00:00
and we see that it comes back and returns the reverse.
00:00
It gives us the DNS name,
00:00
the host name for this IP address
00:00
instead of using the IP address.
00:00
To get the host name, we can use the IP address.
00:00
Instead of using the host name to get the IP address,
00:00
we can use the IP address to get the host name.
00:00
Let's move on and look at our next command here today,
00:00
and that is the host command.
00:00
This is really just a very simple command
00:00
to look up an IP address for a host name.
00:00
It's just designed to do a simple DNS lookup,
00:00
and the way that you use that is just by typing "host",
00:00
and we can do host www.google.com and hit "Enter",
00:00
and it's going to return an IP address.
00:00
We can all host.dns.google.com,
00:00
and that's going to return some IP addresses for us.
00:00
This is real simple. If you just need
00:00
something quick and in
00:00
>> you're in a hurry, just use host.
00:00
>> It's a little less complicated than dig,
00:00
but it's definitely something that's
00:00
useful to use as well.
00:00
We've reached the end of the lesson today,
00:00
and in this lesson we covered the dig command,
00:00
we talked about nslookup,
00:00
and also the host command.
00:00
Thank you so much for being here and I look
00:00
forward to see you in the next lesson.
Up Next