Receive an overview of the DNS system, which resolves domain names to IP addresses.
- The great thing about using smart phones today is that when I actually wanna contact somebody over the phone, I don't dial phone numbers anymore. I just go through my contact list, find the person I wanna talk to and give 'em a quick ring. In fact, contact lists have become so common on smart phones today that, if I were to lose my contact list, I would have the, lotta trouble because I don't remember anybody's cell phone numbers anymore, and that could be a big issue. Okay, 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 Meyer's mobile, I'm actually calling a telephone number.
So for us, the whole idea of telephone numbers becomes obfuscated, it becomes, 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'll 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 this guy's IP address and a webpage 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 wanna 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 fttp server, or a ssh server, or a mail server, or a world of tank 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 bazillions of computers all over the world whose only job is to, you ready? Resolve IP addresses based off of fully qualified domain names. A fully qualified domain name, we've seen them all. For example, www.totalsem.com, or ftp.microsoft.com, or system.fbi.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 wanna 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, www.totalsem.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 www. WWW is the name of one individual computer within the totalsem.com domain. It's my web server. And the reason we use www is really, it's a matter of convention. People are used to going into their web browsers and typing www something when they wanna get to a web server. I could just as easily call it timmy.totalsem.com, but I'm gonna have a lot of trouble when people go up to (chuckles) their web browsers.
They're not gonna type in timmy.totalsem.com. They're expecting www. So there's no magic to the word www, 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'd by convention use ftp.totalsem.com, because people are expecting that for ftp servers. If this was a mail server, people would be expecting probably mail.totalsem.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 a lotta flexibility here, but we do have conventions that are nothing more than etiquettes for a lot of the more common applications. So, we've got the host name, and we've 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 could have a lot more dots. If I wanted to for example, I could have something like www.houston.texas.totalsem dot com. So you could have, I believe it's like 127 individual names. But the total length of a fully qualified domain name cannot be more than 256 characters. So, you can have a lotta 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.
Okay, now understanding that, we can 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 could 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 gonna put a DNS server over here. Now this DNS server is what we call an authoritative server for the dell.com domain. Now, they're a bunch of listings inside this DNS server and here's one of them. So www.dell.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 slash all on this computer, you'll see its 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 www.dell.com? So the first thing your DNS server's going to do, it'll put you on hold.
So (chuckles) you get 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 www.dell.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 'em all written down here.
There's bunch of them, and they're built into most DNS servers that are designed to resolve stuff. And there are a number, it's 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 server is set up, 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 actually, we identified 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 server's job is not to get you to dell.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 associated 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 the dot com server and he says, okay, what's the IP address for dell.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 okay, here it is right here. And he sends that 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, is once your computer has that IP address, of course he can go ahead and talk to that DNS server now. And he's gonna 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 awhile, 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. Just make sure that 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 eight dot eight dot eight dot eight. 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 ISPs 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 (chuckles) local computers within your network, and that would be what we call a bad thing.
We are a CompTIA Content Publishing Partner. As such, we are able to offer CompTIA exam vouchers at a 10% discount. For more information on how to obtain this discount, please download these PDF instructions.