What a subdomain is and why you might need one
A subdomain is a prefix you add to your main domain name that creates a separate web address pointing to a different part of your site or a different service entirely. If your main domain is example.com, a subdomain might be blog.example.com or shop.example.com. Each subdomain can host different content, use different settings, or even point to a completely different server.
Common reasons to create a subdomain include running a blog separately from your main site, hosting an online store, setting up a knowledge base, or pointing to a third-party service like a help desk or email marketing platform. Subdomains let you organize your web presence without buying additional domain names.
Key Takeaways
- You create a subdomain by adding a DNS record (usually an A record or CNAME record) through your domain registrar or hosting provider's control panel.
- Most registrars and hosting providers let you create subdomains for free, though some services you point to may charge their own fees.
- An A record points a subdomain to a specific server IP address, while a CNAME record points it to another domain name — choose based on what you're hosting.
- DNS changes can take anywhere from a few minutes to 48 hours to take effect across the internet, so test your subdomain after waiting a few hours.
- You can create as many subdomains as you need under a single domain name, and each one can have its own SSL certificate for security.
Finding where to create your subdomain
The place to create a subdomain depends on where your domain is registered and where you host your website. If you registered your domain and host your website with the same company — GoDaddy, Bluehost, Namecheap, or similar — you'll do everything in one control panel. If they're separate, you'll need to work in your registrar's control panel to create the DNS record.
Log into your registrar's account and look for a section called DNS Management, DNS Settings, or Manage DNS. In your hosting provider's control panel, look for Subdomains, Addon Domains, or Parked Domains — the exact name varies by host. Some hosts let you create subdomains directly without touching DNS at all, which is simpler if that option exists.
Creating a subdomain with an A record
An A record is the most common way to point a subdomain to a web server. You'll need your server's IP address, which your hosting provider will give you. In your DNS management panel, create a new A record with these details: the subdomain name (just the prefix, like "blog" or "shop"), the record type set to A, and the IP address of your server.
For example, if you want blog.example.com to point to your server at IP address 192.0.2.1, you'd create an A record with the name "blog" and the value "192.0.2.1". Save the record and wait. DNS propagation usually takes a few minutes to a few hours, though it can occasionally take up to 48 hours for all servers worldwide to recognize the change.
Once the DNS change has propagated, visiting blog.example.com in your browser should show the content from that server. If it doesn't work after a few hours, double-check that you entered the IP address correctly and that your hosting provider has configured that server to recognize the subdomain.
Creating a subdomain with a CNAME record
A CNAME record (Canonical Name) points your subdomain to another domain name instead of directly to an IP address. This is useful when you're pointing to a third-party service — for example, if you want shop.example.com to use Shopify, you'd create a CNAME record pointing to Shopify's servers.
The service you're using will tell you what domain name to point to. In your DNS management panel, create a new CNAME record with the subdomain name and the target domain they provide. For instance, if Shopify tells you to point to shops.myshopify.com, you'd create a CNAME record with the name "shop" and the value "shops.myshopify.com".
One limitation: you cannot create a CNAME record for your root domain (example.com itself), only for subdomains. If you need to point your main domain to a third-party service, you'll need to use an A record with their IP address or use a service-specific setup method they provide.
Setting up SSL certificates for your subdomain
Once your subdomain is live, you'll want to secure it with an SSL certificate so visitors see a padlock in their browser and data is encrypted. If your hosting provider offers free SSL through Let's Encrypt or similar, you can usually add your subdomain to your existing certificate or request a new one that covers multiple subdomains.
In your hosting control panel, look for SSL Certificates or Security settings. Most providers let you add subdomains to an existing certificate at no extra cost, or they'll automatically issue a wildcard certificate (*.example.com) that covers all current and future subdomains. If you're using a third-party service via CNAME, that service usually handles SSL for you — check their documentation.
Testing your subdomain and troubleshooting
After waiting a few hours for DNS to propagate, test your subdomain by typing it into your browser. If it doesn't load, use a DNS lookup tool like MXToolbox or Google's DNS checker to see if your record is showing up. If the record appears but the page doesn't load, the issue is likely with your hosting configuration, not the DNS.
Common problems include: the subdomain not being configured in your hosting control panel (you may need to add it separately even after creating the DNS record), the IP address being incorrect, or the server not being set up to recognize that subdomain. Contact your hosting provider's support if the DNS record is correct but the page still won't load.
If you're pointing to a third-party service via CNAME and it's not working, verify that you entered the target domain exactly as the service specified — even a small typo will break it. Some services also require you to verify ownership of your domain before the CNAME will work.
Managing multiple subdomains
You can create as many subdomains as you need under a single domain. Each one gets its own DNS record and can point to a different server, service, or location. If you're planning to create many subdomains, consider using a wildcard DNS record (*.example.com) that points all undefined subdomains to a single server, then configure each one individually in your hosting control panel.
Keep track of what each subdomain does and where it points — a simple spreadsheet with the subdomain name, its purpose, and its target is helpful when you need to update or troubleshoot later. If you stop using a subdomain, you can delete its DNS record to clean up your DNS management panel.
Frequently Asked Questions
Can I create a subdomain if my domain is registered with a different company than my hosting provider?
Yes. Log into your registrar's DNS management panel and create the A or CNAME record there, pointing to your hosting provider's server or the third-party service. Your hosting provider may also need the subdomain added in their control panel so they know to serve content for it.
How long does it take for a subdomain to start working?
DNS changes usually take effect within a few minutes to a few hours, though it can occasionally take up to 48 hours for all internet servers to recognize the change. You can check if it's live using a DNS lookup tool before waiting the full time.
Do I need a separate SSL certificate for each subdomain?
No. Most hosting providers include a wildcard certificate that covers your main domain and all subdomains, or they let you add multiple subdomains to a single certificate at no extra cost. Check your hosting provider's SSL settings to see what's included.
What's the difference between a subdomain and a subfolder?
A subdomain is a separate address (blog.example.com) that can point to different servers or services. A subfolder is a directory within your main site (example.com/blog). Subdomains are better for separating distinct services; subfolders are simpler if everything is on the same server.
Can I delete a subdomain I'm no longer using?
Yes. Delete the DNS record from your registrar's DNS management panel and remove it from your hosting provider's control panel if it's listed there separately. The subdomain will stop working once DNS propagates, usually within a few hours.