If we look at a URL like [http://www.reddit.com/r/explainlikeimfive](http://www.reddit.com/r/explainlikeimfive) this actually contains a lot of information for the computer systems to describe how the webpage gets from the reddit server to your browser. We don’t really read this from left-to-right.
We start with the **domain name,** “[www.reddit.com](https://www.reddit.com)”. This is broken into three parts, which are read right-to-left. “.com” is called the **top level domain (TLD)**. “reddit” is called the **domain name**, and “www” is called the **subdomain**. If you leave it out and just type “[reddit.com](https://reddit.com)” it is usually the same as typing “[www.reddit.com](https://www.reddit.com)”. In other words, “www” is a default subdomain.
Converting a domain name to an IP address happens through the **Domain Name Service (DNS)**. For your computer to get the reddit website, first a request gets sent to the .com DNS server, which returns the IP address of the “[reddit.com](https://reddit.com)” DNS server. Then a request to the “[reddit.com](https://reddit.com)” DNS server returns the IP address of the “[www.reddit.com](https://www.reddit.com)” server. Luckily these values don’t change much, so your computer keeps a copy of these values on your harddrive so the next time you visit reddit you don’t have to call DNS at all.
Once you get the IP address, now you need to know what **protocol** to use. Communications protocols are sort of analogous to human languages. “What language do I need to speak to get this information?” In the case of websites there are two protocols used most commonly: HTTP and HTTPS. HTTP basically is the “language of the web”. If you have a website and want to display web pages, your server needs to speak HTTP. HTTPS is an encrypted version of HTTP for security purposes. Email uses protocols called SMTP and POP3. File transfers may use protocols like FTP, SFTP or UNC. You may also see protocols like TCP, AMQP, etc. There are a lot of them. So that part at the beginning of the url tells the protocol your request is using.
Finally you get to the **Path**. Everything to the right of the domain name “/r/explainlikeimfive” is the path. This is the thing that we are requesting from the server. The server is free to interpret this path information however it wants, so basically on every website you just have to follow the rules of that site. Hyperlinks give information about which paths in a system are (probably) legit.
So when you type [http://www.reddit.com/r/explainlikeimfive](http://www.reddit.com/r/explainlikeimfive) into your browser, the following things happen:
1. DNS asks the .com DNS server for the [reddit.com](https://reddit.com) address, and then asks the [reddit.com](https://reddit.com) DNS server for the IP address of [www.reddit.com](https://www.reddit.com)
2. Then your browser looks at the “http” to know which protocol to use to create the request
3. Then your browser creates an HTTP request message with the /r/explainlikeimfive path and sends this request to the [www.reddit.com](https://www.reddit.com) server
There’s a lot here, but it’s a deep and fascinating subject. I hope this helps scratch the surface for you.
Latest Answers