A subdomain is a domain that is attached to a root domain (or main domain) that can direct browser requests to specific files on a specific server.
You are currently looking at files on LarryLudwig.com – but more specifically, you are looking at files on the LarryLudwig.com root domain (note no www. in my URL). Though I do use a subdomain for my membership area members.LarryLudwig.com.
As an analogy, if a domain is like a physical address, but on the Internet, then a subdomain is like a Suite or an Apartment number. Like a Suite number, they only make sense as part of the larger address, but they allow visitors to access a more specific (and usually different) location.
That’s the short version, but there’s more to subdomains than just the definition and an analogy.
What Is A Subdomain?
A subdomain is the left-most part of a URL and is before the domain name. The subdomain and domain name are separated by a period.
Like I wrote in What Is A Domain Name, the Internet is nothing but a bunch of connected devices with IP Addresses (usually a series of numbers like 192.168.0.1). IP Addresses are not only hard to remember, but they change frequently.
A domain name is a great way to provide a memorable way to locate your information on the Internet. It’s easier to say that your website is at LarryLudwig.com than remembering the IP address 188.8.131.52.
But what if you have several different Internet applications that you want to all live on your domain name? That’s where subdomains come in.
Subdomains always come before the root domain and before the top-level domain (TLD). For this website, LarryLudwig.com:
- LarryLudwig is the root domain
- com is the top level domain
A subdomain is a part of the root domain. You can “point” different subdomains via the Domain Name System (DNS) to completely different server locations.
You can have an infinite number of subdomains and even sub-subdomains with any domain name you own.
A website can also have no subdomain like this very website. If you just see https://website.com (note that lack of anything between https:// and website) – then you are on a website with no subdomain.
That’s how companies can have their website at LarryLudwig.com and their customer portal at app.LarryLudwig.com and their blog at blog.LarryLudwig.com – these resources are all at LarryLudwig.com…but all in different server locations.
What Is a Subdomain Used For?
A subdomain is used for providing different resources all within a single domain name, but usually, the resources will need to be on a different server.
Since a domain can have an infinite number of subdomains, subdomains are often used to limit confusion, maintain a primary online brand, and cut costs (since a new domain name costs money).
For example, a small company might have an employee dashboard that they run with a 3rd party software service but they also might have the main site that they run with WordPress on their own server. They also might have a merchandise store that they run with Shopify.
All three resources need to live under the company’s domain name, but they all live in different places. They would have to setup:
- employee.natecompany.com – Employee dashboard
- www.natecompany.com – Primary website using WordPress
- store.natecompany.com – eCommerce store using Shopify
Subdomain vs. Root Domain
So what is the difference between a subdomain and a domain name? The short version is that a subdomain needs a domain name to work, but a domain name does not need a subdomain to exist.
A domain name is a core part of you and your brand on the Internet. A subdomain is more of a technical workaround. In fact, you don’t even really need the default “www” subdomain.
As far as using a subdomain vs a domain, it’s often simply a preference. Some companies prefer to have their separate projects on separate domain names entirely. Some companies like to have a nice system of subdomains.
Subdomains can create some technical issues (ie, cross-subdomain tracking, security certificates, etc), but they also solve and simplify other issues.
It’s usually a preference of sub-dividing and the organization of the website structure.
Subdomain vs. Subdirectory
A subdomain is a different domain under the root domain. It appears before the root domain in the URL (ie, subdomain.domain.com). A subdirectory is a place on a server where certain files live. It appears after the top-level domain in the URL (domain.com/subdirectory/).
In an analogy, imagine your website as filing cabinets (remember those?). A subdomain would be different cabinets while a subdirectory would be a folder inside of a cabinet.
Now, there is an ongoing & complex debate on whether it’s better to use a subdirectory or a subdomain for distinct sections, campaigns, or microsites.
For example, if you have a Spanish and an English language website, is it better to use es.yoursite.com & en.yoursite.com or yoursite.com/es/ & yoursite.com/en/?
Or, if you have a blog that uses WordPress (and the rest of your site uses Drupal), is it better to use blog.yoursite.com or yoursite.com/blog/?
The short, unhelpful version is that it depends on what software you are using, what your plans are, what your marketing strategy is, and what your technical skills are.
Now, based on my experience as a marketer with a focus on organic traffic & analytics, I say that unless you have a specific, firm reason to use a subdomain, then you should always default to using a subdirectory.
Why? Because Occam’s Razor – a problem-solving principle that states, “Entities should not be multiplied without necessity” or, the simplest solution is most likely the right one.
It may appear that subdomains are easier to implement upfront without planning, but, they introduce a lot of complexity both upfront and forever into the future.
For languages, eCommerce, SEO, analytics, development, security, etc – maintaining a single website location is almost always better.
The only caveat where subdomains usually win is online software that you want to associate with your domain…but not with your website. Customer portals, some forums, and any internal uses work better with subdomains since subdomains inherently separate those functions from the rest of your website.
You probably navigate among subdomains constantly and do not realize it. But here are a few diverse examples of websites that execute subdomains well.
Wikipedia – Languages
Wikipedia is a heavy user of subdomains. They have subdomains for every language and sub-subdomains for mobile versions.
Disney – Brand Identity
Disney is perhaps one of the oldest brands that used a subdomain for the go.com domain and started to be used by Disney in 1995 as a portal website. All of Disney’s brands live under the go.com domain name.
For example, the Walt Disney World resort subdomain is disneyworld.disney.go.com. Disneyland is: disneyland.disney.go.com
Disney is a perfect fit for branding and using separate subdomains for each brand.
In case you are wondering Google treats subdomains as if it’s separate domain names. So in effect with SEO, you can isolate your brands for a large conglomerate.
NPR – Ecommerce
NPR is a radio network, first and foremost. Their main domain NPR.org has to be 100% focused on their member stations, news & content. But, they also have merchandise that they would like to sell on their domain to serious fans. A custom Drupal setup runs their content site, but they use Shopify for their shop. This setup is a perfect example for subdomain use.
Apple – Customer Portal
One of the most recognizable companies in the world, Apple, separates its customer portal from the main part of its website. The use of the subdomain support.apple.com makes it easy to remember where to get help.
Apple includes knowledge base articles, how to get support at the local Apple stores.
How To Create A Subdomain
So let’s say that a subdomain is right for you. How do you actually make that happen?
It is assumed you’ve already purchased a domain name. You must do this before you can set up a subdomain.
To create a subdomain, you need to go wherever your DNS records live (may not be where you registered your domain). If you have a hosting company that is separate from your domain registrar, then you’ll likely go to your hosting company.
If it’s at your web hosting company, then you’ll navigate to your cPanel and/or account dashboard. There will likely be a shortcut called “subdomains” where you can select your domain and add your subdomain. You’ll need to name it, and then tell it where the software lives on your server.
Here’s a screenshot from InMotion Hosting’s subdomain area.
Now, that path is simple if both websites will live on the same server. If your websites live elsewhere, then you’ll likely need to edit the DNS records directly. To do this, find where you can edit the “Zone Records”. Once again, here’s a screenshot from my account at InMotion Hosting.
You’ll notice that there will be several records that already exist. You’ll need to add a “Record” based on the software instructions from your software provider. Usually, this will involve setting an A record and a CNAME record. It usually depends on your software’s exact setup.
Subdomains are useful, but often misunderstood parts of the Web. They can be a cost-effective and versatile way to make the most of your domain name, but they can also be a clunky and complex solution to common website setup issues.
Either way, be sure to understand the tradeoffs and what tradeoffs your subdomain setup involves.