A subdomain is a prefix added to your main domain to create a separate section of your website, like blog.example.com
or shop.example.com
. It functions as an independent space while still being part of the main domain.
When to use a subdomain to separate parts of your website based on purpose, like a blog, store, app, or support system. While each section runs independently, you can still connect them through navigation. For example, a store’s blog hosted on a subdomain can be linked in the main menu to share product reviews and updates.
Another great use of subdomains is for managing staging or development environments. For example, on wpdebugging.com
. We are setting up dev.wpdebugging.com to test, debug, and experiment without affecting the live site, ensuring clarity and a safer workflow.
Log in To Your Domain Registrar
The shared steps and graphics are linked to the Cloudflare dashboard, but the technical steps are similar for any Domain registrar; the dashboard graphics may vary depending on the registrar to registrar.
After logging in to your Cloudflare, select the domain on which you wish to have a SubDomain.

After selecting the appropriate domain, go to the DNS settings and add a new A record with the following details:
Type: A
Name: The subdomain prefix you want to use (e.g., dev
)
IP Address : The IP address of the server where the subdomain’s application will be hosted

After creating a SubDomain, how can we validate whether the DNS records are populated or not? For that, we can use multiple CLI or online tools.
We normally use whatsmydns, but you can use any preferred tool to test.
As you can see, before creating a subdomain, no A record was assigned to the dev.wpdebugging.com SubDomain.

After creating the subdomain records, DNS propagation usually starts within a few minutes. The speed depends on the TTL (Time to Live) you set and can vary based on your DNS registrar. With Cloudflare, propagation is typically faster, though with some registrars, it may still take up to 12 to 24 hours globally.

The IP address you add is routed through the Cloudflare proxy, which helps mask your actual hosting IP. This adds a layer of protection by preventing direct access to your server, reducing the risk of targeted DDoS attacks. Cloudflare provides effective DDoS protection in both its free and premium plans.
If you’re experiencing attacks from bots or spammers, you can enable “Under Attack Mode” for additional protection. For a step-by-step guide on enabling DDoS protection, please refer to the following article: How to enable DDOS protection on Cloudflare.
Conclusion.
Subdomains provide a structured and effective way to separate different areas of a website based on their function or purpose. Whether you’re running a blog, an online store, a support portal, or a custom application, using subdomains allows you to manage each section independently while maintaining consistency under a single primary domain.