Hostname and IP address look up, what exactly that means is if you have the hostname and you want to
find the IP address, how does it work?
We do have DNS, right.
And there are protocols that we run like Ping or we go to a browser and we type in the hostname or the
website name, and it resolves to an IP itself because those are the type of protocols that knows that
it needs to resolve IP address first.
If you don't have those protocols and you just wanted to know the IP or hostname, then you will just
run the commands like A..
Look up and dig.
There are two major commands or tools that are given to us and Linux.
I believe they are also available in Windows, I'm sure.
And look up s but I'm not sure Digg is available.
But you could also dig for Digg to find out if Digg is available on Windows.
So what exactly these tools are these commands do for us?
Again, they resolve hostname to IP, IP to IP or hostname to hostname.
Let's look at them by logging into our system and then through the console and the command I will run
is a..
Look up and you run this.
It will bring me to its own menu.
And if I type here w that Google dot com, it is giving me the IP address of Google.
What is right here, right here is our resolver, meaning this is our DNS server, our DNS.
Ever since we are running our machine local to our modem.
So our modem is our denisova and our modem is also accepting request for DNS and DNS port runs on Port
53.
And when you see the message here, non authoritative answer, it means that when I typed and has to
look up for that IP.
I the my modem does not have the information for that Google dotcom, it went outside on the Internet
to find out information for me.
That is why you see that here, not authoritative.
If I had the information for Google saved in my local computer or in my local DNS server, then I would
not have seen non authoritative answer.
I would have gotten the straight name and address so you could quit out of it or control Serov.
It cleared the screen so you could also unharnessed look up the simply followed by w w w dot.
Let's say this time will do Hotmail dotcom and you will see the Hotmail IP address is right here, two
or four seventy nine one ninety seven to one two.
If you type this IP address into the Linux machine or in your Windows machine, you will get the hose,
you will get the page associated with this IP address.
Similarly, the same command works for Digg, Hotmail the come and you will get the same answer, but
a little differently.
So some people use années look up and some people use Digg nowadays, a lot of people, users and more
inclined toward Digg command as compared to ness.
Look up and look up is a very old utility and you could get a lot more information out of Digg and as
compared to a. lookup to try and look up or Digg comment on different websites like Facebook dot com
and then try to see if you could get this IP and resolve it to the page that you got going to.
So any non example, we could try to open up our server right here, sorry, a browser and in this browser
is called some of the tabs in this browser.
I will type IP address that shows up for.
Facebook.
Which is 31, the 13, that's 71, 36, you hit and enter, you see, it took us to the Facebook, took
us to the Facebook page.
That's how the Internet DNS works.
It does not know that name.
It only knows the IP addresses.
But since we are humans, we we tend to remember the names instead of IP or digits.
That's why it's become easier for us to do to use DNS.
That actually translates hostname to IP address to try these two commands a few times to run man, comment
on them and see how it works.