- Overview
- Transcript
2.1 Networks and DNS
The Internet is a massive TCP/IP network, and having a fundamental knowledge of how it works is useful. I'll tell you what you need to know.
1.Introduction2 lessons, 06:25
1.1Introduction01:51
1.2What You Need04:34
2.How the Web Works2 lessons, 16:03
2.1Networks and DNS09:20
2.2HTTP and the Web Server06:43
3.Creating Documents3 lessons, 27:13
3.1Marking Up a Document09:38
3.2Making Our Document Valid06:22
3.3Semantic and Generic Elements11:13
4.Styling Documents3 lessons, 34:07
4.1Adding Style08:17
4.2CSS Selectors16:15
4.3Modifying Layout09:35
5.Scripting Documents3 lessons, 22:36
5.1Variables and Functions09:06
5.2Writing Your Own Functions05:34
5.3Objects07:56
6.The Document Object Model6 lessons, 42:45
6.1DOM Basics08:58
6.2Finding Elements07:40
6.3Working With `NodeLists`04:30
6.4Manipulating an Element's CSS Classes04:29
6.5Listening for Events08:42
6.6Practicing the Concepts08:26
7.HTTP Requests With JavaScript1 lesson, 09:16
7.1The fetch() API09:16
8.Introduction to Server-Side Development5 lessons, 43:24
8.1Introduction to Server-Side Development10:31
8.2Your First Line of PHP Code06:57
8.3Functions and Variables08:00
8.4Parameters and Decisions08:13
8.5Getting Data From the User09:43
9.Getting Started With Databases3 lessons, 31:01
9.1Create a Users Table12:00
9.2Create a Posts Table10:20
9.3Inserting Data08:41
10.Using PHP to Interact With MySQL4 lessons, 51:59
10.1Reading and Displaying Data12:34
10.2Passing and Validating Data11:58
10.3Updating Data14:52
10.4Joining Data (And Deleting Posts)12:35
11.Conclusion1 lesson, 01:47
11.1Conclusion01:47
2.1 Networks and DNS
The Internet is a conglomeration of many technologies that work together. And later in this course, we're going to look at three of those in more detail, HTML, CSS, and JavaScript. These are languages that we use to create webpages, and use them as the front end for our web applications. But before we get into that, let's first dig into some of the more technical aspects of the Internet, starting with, what is the Internet? Well, really, it's just one gigantic network. And I guess it would be more correct to say that it is a network of networks. Well, what do I mean by that? Well, I am sitting in front of a computer in my home, on my own personal network. So I have this computer, and I have a few others and devices, so that they can all talk to one another. And they are protected from any outside interference due to my router, because it has a built-in firewall, and it blocks any time anybody tries to intrude onto my personal network. However, all of my devices need to get out to the Internet for some reason. They need to go to websites, or contact services, or things like that. So in order to do that, they have to go through the router, which is our gateway. They go through the router, and then that traffic is just sent wherever it needs to go. So the router is a piece of equipment that essentially joins one network with another. So really, my personal network is on the Internet. If it didn't actively block people from just intruding, then people would be able to access the computers and devices that I have on my network. Now, in order to get onto a network, you need to have what's called an IP address. It is a unique number that is assigned to each computer and device on a given network. So I have I don't know how many devices, and each one has an IP address, and they are all unique. Otherwise, they would not be able to get onto, first of all, the network and contact the other computers and devices, and they would also would not be able to get out onto the Internet. So I'm going to run a command called ipconfig on Windows, this shows the IP configuration. Now, IP stands for Internet Protocol, and what I want to focus on is this IPv4 address. We have two types of IP addresses, we have IPv4 and IPv6. IPv4 is an older addressing scheme. However, it is still used, especially with internal networks. And then IPv6 is a newer IP scheme that is a lot more complex than IPv4. Now, you can see here that my IP address for this machine is 192.168.0.114. Each of these numbers that are separated by dots are called octets. And if another computer or device on my network wanted to contact this machine, it would do so by sending information to this IP address. And if this machine wants to get out onto the Internet, it has to go through this default gateway, that is my router, and that is 192.168.0.220. Now, up here, you can see IPv6, and you see that there are colons, and then there are hexadecimal values in between the colons. There's actually one, two, three, four, five, six sets of hexadecimal numbers. So it is much more complex, but it also allows for a lot of devices and computers on the network. Right now, the Internet uses IPv6. Although it still uses IPv4, IPv6 is the new standard. So everything on the network has to have an IP address, otherwise you would not be able to access that computer or device. For example, we are going to ping, that is, we are going to send a packet of data to a computer on the Internet. So this is not going to be on my internal network, the IP address is 216.58.218.142. Now, whenever you ping something, you're basically wanting to check if you can access that resource. It could be a computer, it could be a router, it could be some other network appliance. So by sending a ping, we are essentially wondering if something is there. So that packet of data is going to be sent to that IP address. If there is something there, it is going to see that we are pinging it, and it is going to send a response saying, yeah, I'm here. And so it will do that four times, and we see that we have four replies. We also see the amount of time it took for the ping to go from our computer to the computer at this IP address, and then back. So this was 34 milliseconds for the first ping, 40 milliseconds for the second, 36 for the third, and then 38 for the fourth, and that's pretty fast. Now, this actually happens to be a website, but not every IP address that's on the Internet will take you to a website. That just means that there is something at that IP address. It could be listening for people wanting to view a web page, or it could be something more specific. It could be listening as a web service, so that's like a mobile app could send data to an IP address, and the computer at that IP address would be looking for something specific in order to respond to it. But in our case, we're going to go to the browser. We're going to type 216.58.218.142, and we are going to see that it takes us to Google.com. So we can type in that IP address and go to Google, and that would work. I mean, obviously, it does work. However, we don't want to have to memorize an IP address. That's something that we just don't want to do, especially with IPv6 addresses. So instead, we have domain names, Google.com is a domain name. And that means that there has to be a system that maps a domain name to the IP address. So if we go back to the console, and if we type ping Google.com, we're going to see that it goes to the same IP address. But in order to find the IP address for Google.com, it had to look up to a gigantic database of domain names and their IP addresses. That's called DNS, it stands for Domain Name System. So whenever you want to go to any website, your computer has to first contact what's called a DNS server. The purpose of this server is to give your computer the IP address for the domain that you are wanting to access, and then your computer can then go to that IP address. So I'm going to go back to my console, and I'm going to run ipconfig again, but I'm going to use the/all option. This is going to list all of the settings for my IP configuration. What I want to focus on is the list of DNS servers. Now, I have several, the first is one on my local network. But then I have two others, and these are supplied by my ISP. And yours would be very similar to this, you probably wouldn't have a DNS on your local network. Well, you might, it just really depends upon how your network is set up. But you would definitely have the DNS servers for your ISP. Those servers will give you the IP address for that domain, and then your computer will go to that IP address. But how is DNS configured, well, that really depends as well. I use a service called DNSimple, because DNS can be a rather complex topic, and DNSimple just makes it easy to do. There are several records for DNS, and we're not going to really go over any of those. But here is a record of type A, and we can see that the name is mcpeak.io, and then the IP address is 213.101. 0.180.75. Now, this is one of those IP addresses that will not take us to the actual website. If we go here, we see that we have an error. And the reason is because of how Azure, which is Microsoft's cloud service, handles websites. But if we go to mcpeak.io, it's going to look somewhat similar. But this is actually the page for mcpeak.io. I haven't done anything with this domain, but this is active, and it does work. So for the DNS of my domain, I had to link the domain name to the IP address. And there's a few other things that I had to set up for Azure's service. So that is how our computers get to resources that are out on the Internet. More specifically, they're how they get to the computers that are serving websites. And in the next lesson, we're going to look at web servers and how they work.