What is a URL? Understanding the Different Components
Hostnames, domain names, TLDs, FQDNs, etc... All these terms can be confusing to decipher. This article will breakdown and explain the URL components and how they relate to each other.
Contents
- Introduction
- The Uniform Resource Locator
- Domains and Subdomains
- Root Domain
- Top-Level Domains
- Hostnames And Website Domain Names
- Fully And Partially-Qualified Domain Names
- Wrap Up
- Related Articles
1. Introduction
Hello, my friend! Welcome to another post where you'll be learning the various terminology surrounding the uniform resource locator, or URL. By the end of this article, you will, either, never look at URLs the same way again, or just never look at URLs again. Hopefully, the former.
If, like me, you've been confused by terminology like domains, TLDs, hostnames, etc..., and how they relate to one another, or why some of them seem to be used interchangeably, then this is the post for you!
It's important to clarify terminology, especially if you're discussing complicated concepts with other people. You need some baseline standard to adhere to, otherwise, you risk increasing confusion. The goal here is to make you an expert on the terminology so, if the need arises, you can set the baseline and effectively communicate your ideas.
2. The Uniform Resource Locator
The URL is effectively the website address. Much like how your physical address can be broken down into street number, street name, city, etc..., a URL has a lot of components that are used to locate a website.
Figuring out the difference between all of these terms (figure 1) was exhausting. For the longest time I was using some of them interchangeably, but it is very important that you know the distinctions between all – one, two, ..., seven – seven of these terms!
Before we dive in, the first thing you need to understand is the concept of a 'domain'. I'll start off explaining what a domain is in general, then we'll take a top-down approach, starting with the largest domain, all the way down to the smallest element of the URL, hostnames.
I won't be going into protocols in this post. For now, just know that the default is http, and to make it secure you need a SSL certificate to make it a https.
3. Domain and Subdomains
A domain is analogous to a set in set theory, in that, it is simply a collection of objects. Take, for example, the set {1, 2, 3}. It is a collection containing the objects 1, 2, and 3. But what a set can contain isn't limited to just integers, it can contain any object, including other sets. For example, the set A = {{1, 2, 3}, {4, 5, 6}} is a set containing two set: {1, 2, 3} and {4, 5, 6}.
{1, 2, 3} and {4, 5, 6} are, therefore, subsets of set A. Domains work exactly the same way. In the most general sense, a domain is merely a 'thing' that contains other 'things' inside of it, including other domains.
It's all relative. For example, a set can contain a set, which in itself, can contain another set, i.e {{{Object}}}. A domain, A, can hold another domain, B, which can itself, hold another domain, C. A is the outermost domain, therefore, it is the highest-level domain, B and C are subdomains relative to A, whereas, C is a subdomain to B.
C == {}
B == {C} == {{}}
A == {B} == {{C}} == {{{}}}
Since A is at the top of the hierarchy, it can be referred to as the top-level domain, B would by the second-level domain/subdomain, etc...
If that was a bit too theoretical, then think about the folder system in Linux. Take for example /user/user_home_folder.
At the top you have the root folder /, then you have the subfolder /user, and the subfolder to that /user/user_home_folder. It follows the same concept.
You can apply this concept to anything to an extent: A city can be seen as a domain because inside a city you can have streets, houses, building, etc... The limitation being, that a city cannot contain another city, or anything bigger than itself, like a country.
It's important that you understand the relationship of domains moving forward, so I will once again summarise: A domain is collection of objects, including other domains (subdomains).
Now that we have a baseline understanding of what a domain is, let's go explore the different types of domains, starting from the highest level, the Root Domain.
4. Root Domain
Everything on the internet resides inside one giant domain called the Root Domain, depicted by a trailing period (.) at the end of the URL. This is effectively the universal domain, the absolute highest-order domain that exists. If you were to look back at figure 2, you can think of the root domain as the white space surrounding domain A – assuming other domains exist outside A, if not, then A would be the root domain.
Typically, when you enter a URL into your web browser, for instance, google.com, you don't include the '.' at the end. If you do add it at the end then it will still let you access the website. The reason it's left out is because, since it's the absolute highest-level domain, you can reasonably assume that anything you search for exists inside of it, therefore, it gets abstracted out.
It would be like adding 'Earth' at the end of a physical address. At the time of writing, we are not an interplanetary species, therefore, it is safe to assume that all addresses reside somewhere on planet Earth. If you're giving someone a physical address with 'Earth' at the end, it technically wouldn't be wrong; they could still find the place – assuming everything else is correct – but you don't do it because it's unnecessary and people will probably think you're weird.
5. Top-Level Domains
Top-Level Domains (TLDs) are the next level of domains that reside within the root domain. This is illustrated by figure 4.
Harkening back to set theory (with a touch of algebra), if we just take the root and the TLD, you would get a set like this:
"." = {".com", ".net", ."gov", ...},
where, for example, ".com" = {"MyWebsite.com", "google.com", ...},
You can go even further; "MyWebsite.com" = {"www.MyWebsite.com", "mail.MyWebsite.com", "app.MyWebsite.com"}
TLDs typically consists of .com, .net, .gov, and a whole lot more. The reason there's so many is because the TLD gives an indication of a websites purpose. Back when the internet was still young there were a lot of commercial website, 'com' being short for 'commercial'. Nowadays .com is ubiquitous, any kind of website can be registered under the .com domain.
.net is short for network, typically reserved for networking, or forum sites. .edu would be for educational institutions (universities, colleges, etc...).
At the end of the day, these TLDs, are just names. You can register a domain on whatever TLD you want, and create any website you want. They're just there to help you organise and make it easier for people to find your site.
6. Hostnames And Website Domain Names
You can go to one of many publicly available domains registrars such as
and purchase a website domain, under any TLD. The real-life equivalent would be buying real estate, where you're buying the land and anything attached to it.
Here you're buying, or rather renting, a part of the TLD. This 'part' becomes a subdomain. Pertaining to figure 5, you would be 'renting out' a subdomain of the .com TLD, and naming it MyWebsite.com (assuming the name isn't taken). You are now free to create any number of hostnames inside MyWebsite.com
Now let's move onto hostnames. If we scale down to a small local network, for instance, your personal wifi router, each device that's connected to your network would have a corresponding hostname to identify it on the network. If it's your laptop, then this would be whatever your laptop name is, if it was your phone, then the name of your phone would appear on the network.
To find your hostname on a Mac or Linux, you just need to open the terminal. Typically in the format username@hostname. If, for whatever reason, it's not showing the you can find it by typing uname -n
or hostname
and it will display the hostname.
For Windows, it's a matter of opening up cmd and typing in 'hostname' into the terminal.
That's effectively what a hostname is: A human-readable 'name' of the machine on a network. The non-human-readable equivalent would be media access control (MAC) addresses, but we won't go into that here.
If we scale back up to the internet-level, then your hostname is what you type into your web browser to find the server that is hosting it on the internet, which, as you know, is just a huge network.
Think of a hostname as the end-point. Browsing the internet is a matter of finding the right machine with the content that you want. I will go into DNS and how it works in another post.
This is how I remember it: A hostname is the 'name' of the physical machine that is 'hosting' your website on the internet.
Figure 8 is my way of illustrating how www. and www.MyWebsite.com are both valid hostnames. It all depends on the scope.
If your scope is within the domain MyWebsite.com, then www. is a valid hostname. If you're scope is the entire internet, then www. is not enough information because many domains share that same hostname. You need the rest of the URL (MyWebsite.com) so everyone knows what you're talking about.
7. Fully And Partially-Qualified Domain Names
A fully-qualified domain name (FQDN), aka, the absolute domain name is the full information required by your web browser to find a machine on the internet. In essence, it's the same as a hostname, in that, it's what the DNS uses in order to track down an ip address. You will always find that they are written in the hostname.domainName.TLD formate.
A Partially-Qualified domain name (PQDN) is the minimum amount of information required by your web browser to find the website. It's a bit like giving the Uber driver just the street name, and they magically know the location of the building you want.
The format is the same as FQDN minus the hostname (domainName.TLD). Using both will take you to the exact same place; I'll tell you how that works when we cover DNS records in a different post.
Now you might be thinking "If the F/PQDN is for finding the web server for the website, then why isn't it called fully/partially-qualified Hostname?"
It's because, depending on the context, hostnames, domain names, and subdomains can be used interchangeably. Figure 10 and 11 illustrates that hostnames can, in turn, be used as domains to house other hostnames.
A more concrete example is, when you sign up with a domain registrar – websites that lets you purchase and manage domain names – and purchase a domain name, the registrar automatically assigns you two nameservers where your domain information is stored. This can looks something like server1.ns.cloudflare.com and server2.ns.cloudflare.com, the 'ns' being a shorthand for nameserver.
The main takeaway is that hostnames can also be seen as domains, because they have the potential to house other domains if the user wishes to add more. In that sense, you can look at hostnames as empty domains.
These last two sections have probably been the most confusing because there's a lot of overlap between hostnames and FQDN, and domain names.
www.MyWebsite.com can be called a hostname or an FQDN, but you have to remember that the distinction, just like everything else, is based on context.
In a vacuum, www.MyWebsite.com is seen as a regular web address. With respect to the website domain name, www.MyWebsite.com is a hostname. When speaking of DNS records, it is considered an FQDN. Don't worry if it's confusing, you'll get it eventually. Just remember, context is everything.
8. Wrap Up
The internet can be a strange and confusing place, but hopefully, after reading this articles, you're now a little less confused as far as URL terminology is concerned.
If your line of work involves tech, particularly the networking, then it's important you understand these terms and how they relate so that you can communicate ideas better.
Just remember: Root Domain > TLD > Website Domain Name > Hostname, and the use of some of the terms are determined by context.
Thank you so much for taking the time to read this incredibly lengthy post! It took a long time to write the content and draw the illustrations, but it was worth it if you managed to learn something!
If you're still a little confused then I highly recommend researching these terms from other articles, or videos, so that you can build a better picture of everything I explained.
Happy learning! Till next time!