While writing the article on Firewalls and IT Security Risks, I saw it well to plan and discuss the basics on how we get to the internet. There are two aspects here, the URL and the DNS.
The URL is a string of characters that is used to identify specific resources on the internet. We can call it a map or the GPS of the internet that helps your computer find its way to the specific place you want to visit such as website. Now, imagine the internet as it is as a vast city with countless buildings and networks of streets and each building has a unique identifier like a street address that helps people find it. Similarly, each device connected to the internet has a unique numerical address called an IP address that map with name identifiers of websites we want to visit. By studying URLs, you can gain valuable insights into how the internet works and how to effectively use it as a tool.
URLs are like human-readable street addresses that use words and symbols to represent a specific location on the internet. For example, www.raymondbett.com is a URL that points to this website, a blog. IP addresses on the other hand are the underlying numerical addresses that computers (and servers) use to communicate with each other and are usually a series of four numbers separated by dots like 192.168.1.100. Again, we have two versions and different classes of IP addresses, which we shall cover in another article.
How do they connect?
This is where the Domain Name System (DNS) comes in and it is like a global phonebook that translates the human-readable URLs into numerical IP addresses that computers can understand. When you type a URL into your browser, the DNS server looks up the corresponding IP address and directs your computer to the correct website. As indicated above, it is unlikely for someone to grasp and memorize all the IP addresses of the servers, websites and systems that one would want to access everyday; but for hostnames like raymondbett.com it is much simpler and easier to memorize.
Now, once your computer has the IP address, it uses network routers it is connected to, to find the best path to reach that particular website. Here, think of it as using a map to navigate through a city.
In essence URLs are the friendly, human-readable addresses, while IP addresses are the technical, numerical addresses that computers use to communicate on the internet and the DNS acts as the translator between the two. We shall cover more about the DNS in our subsequent articles and how it is the unsung hero of the internet, quietly working behind the scenes to connect us to the content we want.
Now, let’s get back to the URL. It consists of several components, each serving a particular role.
Parts of the URL
1. Protocol: The protocol specifies the communication method used to access the resource. We can also refer to it as a scheme.
Common protocols in use are;
- http: Hypertext Transfer Protocol used for websites
- https: Hypertext Transfer Protocol, Secure used for secure communication to the websites
- ftp: File Transfer Protocol used for transferring files
- mailto: Used to create hyperlinks that open the user’s default email client to send an email.
2. The Subdomain is a subdivision of the main domain and it’s a way to organize a website into smaller more specific sections. Traditionally, the acronym ‘www’ is a subdomain that points to the main website content. In some cases a custom domain such as consultant.raymondbett.com is used to separately display other contents.
3. The domain or the second-level domain is sometimes called hostname that represents the domain name of the server hosting the website and is also the address of the website, like the street address of a house. Just to expound on this, a domain name can have multiple hostnames associated with it. For example the domain raymondbett.com might have hostnames like www.raymondbett.com , mail.raymondbett.com and consultants.raymondbett.com to identify different services on the same domain.
4. Top-Level Domain (TLD) indicates the general category or purpose of the website. Some common examples are .com for commercial purposes, .org for organizations, .net for network, .gov for governments and .edu for education. Also, we have country-code TLDs such as .ke (Kenya), .us (United States) and .uk (United Kingdom).
5. Port Number: This is an optional component that specifies a specific port on the server where the resource is listening. When it is omitted, the default port for the protocol is used (for example port 80 for HTTP, port 3389 for RDP and port 3306 for MySQL). This is like the transportation method and as such, we can take http is like driving, while https is like driving in a bulletproof car that is more secure. In this case, https://raymondbett.com is using port 443 instead of the default port 80 for http://raymondbett.com. As a more deep example, port 8080 is often used as an alternative port for HTTP, especially when port 80 is already in use. Now, if you’re running multiple web servers on the same machine, you can use different ports for each server to avoid conflicts.
6. The path sometimes called the slug specifies the location of the resource within the server’s file system indicating the directory structure and filename of the resource. This is the specific location within the website, similar to a room or floor in a building. For example,
https://raymondbett.com/resources is accessing the “resources page” in the raymondbett.com website while http://www.example.com/products/shoes/sneakers gives you access to a specific product in the products page.
7. A Query string separator separates the path from the query string and the question mark (?) is typically used as the separator.
8. The query string: This too is an optional component that provides additional information to the server to process the request and is typically used to pass parameters or variables to the server-side script. This is like adding extra instructions or questions to your journey. The URL https://raymondbett.com/?s=threats searches for the word “threats”) in the whole website.
9. Fragment identifier: An optional component that specifies a specific part of the resource to be displayed or referenced. It is often used to bookmark a particular section of a web page and it is like pinpointing a specific spot within the website, like a particular paragraph or image.
- http://www.example.com/page.html#section2(jumping to the “section2” part of the page)
- http://www.example.com/article.html#comments(going directly to the comments section)
A complete URL example:
https://www.example.com/products/shoes/sneakers.php?color=red&size=10#reviews
This URL:
- Uses the HTTPS protocol for security.
- Accesses the “sneakers.php” page in the “shoes” directory within the “products” directory.
- Passes parameters “color” and “size” to the server.
- Jumps to the “reviews” section of the page.
So, the next time you’re surfing the web, remember that you’re following a digital treasure map and the URL is like a friend giving you directions to their house. It’s a little confusing at first, but once you get there, you’ll never get lost again!