The great thing about using smartphones today is that when I actually want to contact somebody over
the phone I don't dial phone numbers anymore I just go through my contact list find the person I want
to talk to and give me a quick ring.
In fact contact lists have become so common on smartphones today that if I were to lose my contact list
I would have a lot of trouble because I don't remember anybody's cell phone numbers anymore and that
could be a big issue.
OK I've got a couple memorized but for the most part I'd be in big trouble.
You see we're so used to using contact lists for phones we forget that I'm not actually calling Mike Meyers
mobile.
I'm actually calling a telephone number.
So for us the whole idea of telephone numbers becomes obfuscated because it disappears into the
haze because of contact lists.
Now the exact same thing takes place in the computer world.
Now let's say I've got two computers in this case it'll be a web browser and this will be a web server.
This web browser wants to talk to this web server and the only thing associated with this web server
is an IP address.
So I could go into my little web browser and type in HTTP colon whack whack.
And then this guy's IP address and a web page will pull up.
But that's a terrible way to do things because as human beings we're not really good at memorizing telephone
numbers.
I mean IP addresses.
So what we want to do instead is come up with a contact list system for every server on the Internet.
Now keep in mind the example I'm using right now is a web server but this would work equally well for
an FTP server or ssh server or a mail server or a world of tanks server. It really doesn't matter if
you have a server there's an IP address associated with it.
And as human beings we're terrible at memorizing this.
So we need some kind of contact list.
Well the contact list that I recommend to you is called the domain name system or DNS. DNS is only one
thing.
It is a zillions of computers all over the world whose only job is to your ready resolve IP
addresses based off of fully qualified domain names. A fully qualified domain name
we've seen them all for example w w w dot total sem dot com or FTP dot Microsoft dot com or system dot FBI dot
gov.
I mean there's zillions of these computers out there and the DNS's job is to take these fully qualified
domain names and then find out what the IP address for these individual devices are and then hand it
to your computer so it can then work.
Now before I want to get into exactly how DNS works let's take a moment and understand the structure
of fully qualified domain names.
So let's start with one that's near and dear to me.
W w w dot total Sem dot com.
So this is the web server for my company.
Now if we take a look at this and starting on your right my left you're going to see that there is a
dot com. There are basically a number of fully qualified top level domain names.
And you've seen these names like dot com dot edu dot gov.
All of these have to be established if you want your computer to be part of the big Internet DNS system.
So that's your top level domain.
Now if we go all the way to your left you're going to have the individual host names.
So for example in this example I have w w w. w w w is the name of one individual computer within the
total sem dot com domain.
That's my web server.
And the reason we use W W W is really it's a matter of convention.
People are used to going into their web browsers and typing w w w something when they want to get to
a web server.
I could just as easily call it timmy dot total sem dot com but I'm going to have a lot of trouble when people
go up to their web browsers.
They're not going to type in timmy dot total sem dot com, they're expecting
W w w.
So there's no magic to the word w w w It's just good etiquette.
Now this is maybe for web browsers but we do other things for example if I had an FTP server we by convention
use FTP dot total sem dot com.
Because people are expecting that for FTP servers.
If this was a mail server people would be expecting probably mail dot total sem dot com because when people
are configuring their web clients they're expecting to type in something like that.
So the name of the host can be anything there's lot of flexibility here but we do have conventions that
are nothing more than etiquettes for a lot of the more common applications.
So we got the hostname and we got the top level domain.
Let's talk about this guy in the middle or our secondary domain.
Now underneath your top level domains are millions and I mean millions of these secondary domains and
there's all kinds of flexibility in here for example when you look at this entire fully qualified domain
name you'll see it has three pieces the host the secondary and the top level domain.
There's nothing wrong with that but keep in mind you can have a lot more dots if I wanted to for example
I could have something like w w w dot Houston dot Texas dot total sem dot com. So you could have
I believe it's like a 127 individual names but the total length of a fully qualified domain name cannot
be more than 256 characters so you can have a lot of flexibility in here.
However keeping it simple for right now for the most part especially for things that are exposed to
the Internet
you're going to have these three pieces the host the secondary and then the top level domain.
OK now understanding that we could actually begin to resolve ourselves on the Internet.
Let's take a look down here now.
What I have here is a web browser over here and a web server over here.
Now the IP address for this web server is 68 109 30 145.
Now if I want my web browser to be able to see this web server I need to get that IP address to my web
browser so that he can open up that web page. Now to do that we use DNS.
Now the secret to DNS are the DNS servers.
So first of all I'm going to put a DNS server over here.
Now this DNS server is what we call an authoritative server for the dell dot com domain.
Now there are a bunch of listings inside this DNS server and here's one of them.
So w w w dot dell dot com is this IP address.
So if we can get something to query this DNS server it has the information we need and it's ready to
give it to us.
Now your computer itself never directly queries a DNS server.
Instead what we do is we have our own DNS server.
So keep in mind the DNS servers do two things they respond to DNS queries and they create DNS queries
and one DNS server can often do both.
But in this case I'm separating the functions So first of all this DNS server.
It might be a DNS server that's in your network.
If you're connecting to an ISP like with a cable modem This is probably controlled by your Internet
service provider.
I don't care where this DNS server is physically.
The important thing is is built into your computer right here
are DNS server settings and if you type ipconfig/all on this computer you'll see it's DNS settings.
These settings are provided to your computer.
You can type them in statically.
You can get them through DHCP. However you get them
I guarantee you that your computer has some association with this DNS server. Anyway.
So when your computer wants to know the IP address for a particular location what it's going to do is
it sends out a query over to its DNS server and it asks the question What is the IP address for w w
w dot dell dot com.
So the first thing your DNS server is going to do is put you on hold so you get the one of these one
moment pleases and a lot of times you can actually see this if you look at the bottom of a web browser
for example you'll see it says things like waiting for w w w dot dell dot com.
That's because you're actually waiting for this DNS resolution process to take place.
So your computer has built into it the DNS settings for your local DNS server however your DNS server
has built into it what are called the root hints. The root
hints, I haven't even gotten them all written down here,
there's a bunch of them, and they're built into most DNS servers that are designed to resolve stuff.
And there are a numbers like 13 different IP addresses that pretty much never change.
And these are what are called your root DNS servers. Your root DNS servers are all over the world and
depending on how your DNS servers setup it will either randomly or round robin or whatever.
Pick one of these and it will go to one of these IP addresses to these root servers.
Now we actually identify the root servers as just a little dot.
So I put it in quotation marks there so you can actually see the dot and the root servers job is not
to get you to dell dot com but instead what it's going to do is it's going to respond back and say I
can get you to the closest dot com server.
So then we have many many hundreds of all these different type of DNS servers.
Now these DNS servers their job is to be the main DNS servers for anything
associate with dot com or dot edu or dot gov or dot mil or dot org or whatever it might be.
And then your DNS server once he has this information.
He then goes to dot com servers and he says OK what's the IP address for dell dot com now.
Because we're talking to the dot.com server.
His job is to know anybody with the last name dot com and he responds back with OK here it is right
here and he sends it over to your DNS server.
So now your DNS server has the IP address for this guy right here so he can then go over to this guy
and say what's the IP address for www.dell.com and he has the answer and he'll go ahead and respond
back to your DNS server with that information.
Your DNS server in turn will hand that to your computer.
Now the cool part is once your computer has that IP address of course he can go ahead and talk to that
DNS server now and he's going to do that.
But more than that happens for example stored in your computer is a DNS cache.
He will keep that IP address and know that it's associated with www.dell.com for a while in case
you might need it again.
Also pretty much any DNS server also caches that.
So if we were to bring another computer in line and that computer wanted to talk to www.dell.com
we wouldn't have to go through all this DNS resolution simply because he would be handling it right
there, to make sure this recursive process can take place.
Our main job more than anything else is making sure our individual computers have DNS server addresses
that they can get to and that's a big issue.
DNS servers go up and down all the time.
So one of the fun things we can do with our individual computers is that we can set up really really
popular DNS server names.
One of the most famous is the Google DNS server 8.8.8.
It is a super powerful DNS server and it works for just about anybody and you can type that into your
individual computer.
And it's often faster than your own ISP DNS server or anything else.
Keep in mind that this is very cool but if you have your own in-house DNS server and you try to replace
it with that Google one your DNS server might be helping you resolve for local computers within your network.
And that would be what we call a bad thing.