Manually entering IP addresses into all our devices is an administrative nightmare. To avoid this mess, smart techs us the Dynamic Host Control Protocol (DHCP) to automatically provide IP addressing to individual hosts.
- Quick; what I want you to do is pick somebody who you call on the phone a lot and tell me what their phone number is. I'm not talking about somebody critical like one of your kids or your spouse or somebody like that. We tend to memorize those numbers. I'm talking about that person from work or school that you call a lot but you can't actually know their phone number. Why can we get away with that? The reason is is because we use contact lists on our phones. Whenever we meet somebody new, we enter in their phone number and their name, but from there on in, we just go ahead and hit their name and we get to it.
The same thing happens on the Internet. All around the Internet, we have all of these computers. All these computers have IP addresses. That's how computers communicate, is from IP address to IP address. The problem with computers is that they have to deal with these horrible things called human beings, and we're just terrible at trying to remember that a particular website is 18.104.22.168. We'd rather type in things like www.totalsem.com. What we're looking at is a contact list for the Internet that we call DNS.
DNS has only one job, and that is to take these things called fully-qualified domain names, for example, www.totalsem.com, that's one example, and what it does is it then figures out what IP address is associated with that. When you go into a Web browser and you type in www.totalsem.com and hit Enter, what's actually taking place is the DNS system is resolving that name to a known IP address and then it sends out the packet.
You don't see any of this, but it's happening. DNS makes our lives absolutely fantastic. In fact, DNS replaced something called the hosts file. The hosts file lasted as the primary way to resolve names into the mid-1990s, and for the record, every computer on Earth still has a hosts file. I want to show you an example of a hosts file from way back in the day. Take a look at this. What you're seeing here is a bunch of IP addresses and then names of individual computers.
Back in the old days, what would happen is that if you wanted to join the Internet, you would type in your IP address and you'd give your computer some name, and then you would submit that. And then every morning 3:00 AM, that hosts file was distributed to every single computer on the Internet. You can imagine after the Internet got past a few thousand computers, this was a nutty, nutty way to do things. While hosts files still exist, DNS is now king. To really understand DNS, let's go through an example.
DNS begins through these clusters of super powerful DNS servers that are spread all around the world called the root servers. The root servers control one fully-qualified domain name called dot. I'll show you how this works in a second. Underneath this are tens of thousands of clusters of computers who are all in charge of certain what we call first level domain; for example, like .com, .edu, .gov.
There's lots of these. There's seven primaries and then a lot of secondary ones as well. There's tens of thousands of these. And then underneath this are hundreds of thousands of DNS servers that control second level domains; like for example, there is a computer that controls totalsem.com domain. Also, by the way, this one computer could also handle probably about 30 or 40 other domains. It just depends how much requests they get. Something like google.com (laughs) is going to have hundreds of DNS servers whose only job is to handle that one google.com just because of the amount of traffic they get.
Inside this computer is a sheet of paper and it'll have things like www, and then it'll say whatever that IP address is. This entirety is our DNS. What happens now; here's my computer down here. What I first have to do is connect to a DNS server. This DNS server is not what we call an authoritative server. These are all authoritative. This guy's job is just to help us find stuff. What's going to happen here is, let's say I open up a Web browser on my computer and I want to go to www.totalsem.com.
The first thing that's going to happen is because we have a DNS server entered into our computers, it has to be typed in or provided by DHCP, is that the moment you hit www.totalsem.com and hit Enter on your Web browser, it will automatically go up to your DNS server and you'll ask the DNS server this simple question; do you know what the IP address for www.totalsem.com is? We'll pretend for the moment that he doesn't. But what this server does have is a list of all the IP addresses of all the root servers all over the world, and he's going to pick one based on geography, whoever responds fastest, and he's then going to go up to that root server and he's going to go, "Oh great root server, do you know who www.totalsem.com is?" And the root server's going to say, "Nope, but I know where the .com servers are.
In fact, I know where the closest one is for you." And then your DNS server's going to go, "Oh, thank you." So now he has that IP address. Now your DNS server's going to go to that .com server and he's going to go, "Oh great .com server, do you know the IP address for www.totalsem.com?" The .com server will say, "No, I do not know. But I do know who the authoritative server for totalsem.com is." Now that your DNS server has that, he goes to the authoritative server for totalsem.com and he goes, "Oh great totalsem.com DNS server, do you have the IP address for www.totalsem.com?" And he says, "Yes I do," and he hands you the address.
He hands the DNS server the address. The DNS server in kind then sends it down to you and you go ahead and now start hitting that website. You've actually seen this in action. Next time you open up a Web browser and you type in a webpage that you've probably never gone to before, you're going to notice a little bit of a stutter. If you look in the lower left-hand corner, most Web browsers have this, it'll say waiting for whatever you're trying to get to. That's the DNS process at work. However, sometimes it works a lot faster, and let me show you why.
It all boils down to caching. Once your computer asks for www.totalsem.com, your computer will keep a copy of that IP address internally in itself. Also, your DNS server will keep a copy of that as well. If somebody else who uses the same DNS server suddenly goes, "I need to get to www.totalsem.com," it's like pow; you instantly get the answer because he will keep a copy for a certain amount of time. We call that caching.
Where do these fully-qualified domain names come from? You can't just type in anything. I can't sit here and go, "I want to be google.com." Somebody might not be happy with that. So we go through a registration process. We register a unique name. That name, once it's verified, is unique, is now yours. Usually have to pay somebody a little bit of money to register that particular fully-qualified domain. But once you have it, you then assign it to a DNS server. There's lots of services out there that'll be like, "We will register you a domain name and we'll set up a DNS server." You can have a Web interface so you can configure your DNS server.
It can all be handled from the top like that. Once you've got that, you can then begin adding your own WWWs, or hub, or Mike, or whatever you want into that. The only limitation to DNS is that it has a 256-character limit. That even includes the dots, so you need to be careful with that. The beautiful part about DNS is that 98% of the time, it works perfectly well. It's just that other 2% where it can be a little frustrating. (upbeat jazzy music)
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.
- How TCP and IP work together
- Special IP addresses
- Port numbers
- Working with DNS
- Basic and advanced router configuration
- Troubleshooting networks
- Connecting to a Wi-Fi network
- Repairing wireless connections