What Is a Subdomain? How to Find Subdomains of a Domain
Published November 2026 — Current as of November 2026 — Estimated read time: 7 minutes
When you type blog.example.com into a browser, you are using a subdomain — a name attached to the left of a root domain like example.com. Subdomains are one of the most common DNS patterns on the internet: they separate services, organize content, and let one domain support many products. They are also one of the most commonly forgotten parts of an organization's infrastructure, which is exactly why attackers look at them first.
This guide covers how subdomains work, why they matter for security, and how to find subdomains of any domain — manually with crt.sh and dig, plus our free Subdomain Enumerator.
1. What Is a Subdomain?
Domain names are hierarchical. In blog.example.com, the rightmost label com is the top-level domain, example is the second-level (your registered) domain, and blog is a subdomain — a label added to the left of your primary name. The DNS naming structure that defines these labels comes from RFC 1034, the foundational specification for the Domain Name System. Every dot-separated label creates a deeper level of the name hierarchy, and you can stack them: api.us.example.com is a subdomain of us.example.com, which is a subdomain of example.com.
The key distinction for security purposes is between the root domain (also called the apex, example.com) and its subdomains (blog.example.com, mail.example.com). The root domain is the name you registered with a registrar and its DNS zone covers the whole namespace beneath it. Subdomains are configured as DNS records inside that zone — most commonly A or AAAA records pointing to an IP address, or CNAME records pointing to another hostname. Change the record, and the subdomain points somewhere else; delete it, and the subdomain stops resolving unless something else in the zone answers for it.
One common source of confusion is a wildcard DNS record, written as *.example.com. Wildcards were introduced in RFC 1034 and their exact behavior was clarified years later by RFC 4592. In practice, a wildcard makes the name server answer for any label that does not already exist in the zone: anything.example.com, whatever.example.com, even random garbage like x7k2.example.com all resolve. Wildcards are handy for catch-all routing, but every invented name resolves — which pollutes enumeration results and can mask a record you thought you deleted.
2. Common Legitimate Uses of Subdomains
Organizations create subdomains for reasons that make perfect sense at the time — and that is exactly why they accumulate:
- Service separation. mail.example.com for email, blog.example.com for content, app.example.com for the product, api.example.com for programmatic access. One domain, many independently operated services — each with its own DNS record, certificate, and deployment lifecycle.
- Environments and release management. staging.example.com and dev.example.com let teams test changes without touching production. These are prime takeover candidates because demo and staging environments are frequently decommissioned without updating DNS.
- CDN and delivery organization. Static assets often live on cdn.example.com, short links on go.example.com, and file uploads on uploads.example.com — often CNAME records pointed at a content delivery network.
- Multi-tenant hosting. SaaS platforms give each customer a namespace like acme.example.com or tenant1.example.com, frequently with DNS records created programmatically — and just as often never removed when a customer churns.
None of these uses are a problem by themselves. They become a problem when the underlying service disappears and the DNS record stays behind. That scenario has a name: subdomain takeover.
3. Why Subdomains Matter for Security
Attack surface research starts with subdomain enumeration for a simple reason: a subdomain is often the weakest, least monitored entry point into an organization. Nobody remembers who created that test2 record for a proof-of-concept last year.
Subdomain takeover: the dangling-record problem
The OWASP Subdomain Takeover Prevention Cheat Sheet defines the vulnerability precisely: a subdomain takeover occurs "when a DNS record (typically a CNAME) points to a cloud resource or third-party service that has been deprovisioned or no longer exists," and an attacker claims the orphaned resource and serves arbitrary content on the victim's subdomain. OWASP notes the issue "is consistently among the most reported findings in bug bounty programs."
The mechanics are straightforward. An organization points blog.example.com at a Heroku app, a GitHub Pages site, an Azure App Service, or an S3 bucket via CNAME. Months later the team decommissions the cloud resource but forgets the DNS record. The CNAME now floats — a "dangling" record pointing at a name that no longer exists. If the provider lets a new customer claim that resource name (S3 bucket names, Heroku app names, and Azure app names are globally unique and reusable), an attacker registers it and instantly controls everything served on blog.example.com. Microsoft's guidance on preventing dangling DNS entries describes the same pattern for deprovisioned Azure resources.
Because the takeover happens at the DNS layer, impact extends far beyond a defaced page. Per OWASP, an attacker controlling a subdomain can steal session cookies scoped to the parent domain (cookies set for .example.com are sent to the attacker's subdomain), bypass Content Security Policy rules that trust *.example.com, host convincing phishing pages on a name users already trust, compromise OAuth and SSO flows that list the subdomain as a redirect URI, and obtain valid TLS certificates for it — visitors see a green padlock on a page that does not belong to you. The OWASP Web Security Testing Guide covers how to detect and validate these conditions in testing.
How attackers discover subdomains
Attackers do not need inside knowledge to find your forgotten subdomains. Three public techniques cover most discoveries:
- Certificate Transparency logs. Every publicly trusted TLS certificate is logged by design — that is the point of Certificate Transparency, specified in RFC 6962. Services like crt.sh, a free public Certificate Transparency search engine operated by Sectigo, return every hostname that has ever appeared in a certificate for a domain. Since almost every real service gets a certificate, CT logs are the single richest public source of subdomain names.
- DNS brute force. Attackers query a DNS resolver with wordlists of common labels — mail, ftp, test, staging, vpn, product names, employee initials — and keep every label that resolves. Wildcard records make this noisier but not impossible; careful queries correlate responses against the wildcard baseline.
- Search engines and public data. Search operators like site:example.com surface indexed subdomains, and passive DNS and historical archives preserve long-decommissioned hostnames.
The threat is taken seriously enough that CISA's Emergency Directive 19-01 (issued in 2019 after a wave of DNS infrastructure tampering) required federal agencies to audit their public DNS records and monitor Certificate Transparency logs for certificates issued for their domains that they did not request. Auditing your own subdomains is the same discipline applied to your own assets.
4. How to Find Subdomains
You can enumerate subdomains by hand in a few minutes — and on your own domains, you should.
Manual method 1: Certificate Transparency (crt.sh)
Visit crt.sh/?q=%.example.com (substitute your domain) — the %. prefix asks for any label under the domain. The result table lists every certificate hostname, issuer, and log date. Group and deduplicate the hostnames and you have a baseline inventory in under a minute. The same data is available programmatically through crt.sh's JSON output endpoint, which is how most enumeration scripts — and our tool — pull it.
Manual method 2: dig and NSLOOKUP
Once you have candidate names, confirm they resolve. On Linux or macOS, dig returns the record directly:
dig blog.example.com dig -t A blog.example.com dig -t CNAME cdn.example.com
On Windows, NSLOOKUP does the same:
nslookup blog.example.com
You can also test whether a zone accidentally allows zone transfers (AXFR), which would dump every record at once: dig example.com AXFR. It almost never works on a properly configured server — per RFC 5936 zone transfers are restricted to authorized secondaries — but the one time it does is worth knowing about.
Manual method 3: DNS brute force
Feed a wordlist of common labels into a script that queries your resolver and records which names return answers. Open-source tools like subfinder, amass, and dnsrecon automate exactly this — combining CT logs, brute force, and search-engine sources into one pass. The output still deserves a human review: a wildcard record makes everything resolve, so deduplicate against the wildcard baseline before trusting the list.
Find Subdomains of Any Domain — Free
Our free Subdomain Enumerator checks Certificate Transparency logs, SecurityTrails, and other public sources to list as many subdomains as it can find for any domain — no signup required. Run it on your own domains to build your attack surface inventory.
Find Subdomains Now →5. Practical Checklist: Keep Your Subdomains From Becoming Someone Else's
- Enumerate your own domains regularly. Run a subdomain search on every domain you own at least quarterly and before and after big infrastructure changes. Flag any hostname nobody can explain.
- Watch for dangling records. For every CNAME in your zones, confirm the target still exists and serves your content — not a provider error page. OWASP's cheat sheet lists provider error fingerprints — "NoSuchBucket", "No such app" — that reveal a missing backend.
- Decommission in the right order. Per OWASP, when retiring a service: serve a maintenance page or redirect first, remove or repoint the DNS record, wait out the TTL (typically 300–3600 seconds), then deprovision the cloud resource. Doing it in reverse opens a takeover window.
- Monitor Certificate Transparency. Alert on any certificate issued for your subdomains that you didn't request — CISA and OWASP both treat unexpected certificates as a red flag, often the first sign a takeover is in progress.
- Keep DNS tidy. Document what each record points to, who owns it, and when it can go. Use version-controlled DNS so changes are reviewed and audited. Remove wildcards you don't need — they hide deleted records and make monitoring noisier.
- Secure the DNS control plane. Enable multi-factor authentication and audit trails on every account that can change your DNS records — the controls CISA required of federal agencies in 2019.
6. Find Subdomains Now
Subdomains are the part of your attack surface that grows without a committee decision. Discovery is cheap and public: with Certificate Transparency, DNS queries, and free tools, you can see your own domains the way an attacker does in minutes.
Use Our Free Subdomain Enumerator
Enter a domain and get every subdomain our sources can find — from CT logs, SecurityTrails, and more. Free, no signup.
Find Subdomains Now →Once you have a list, resolve the interesting names with the DNS Lookup Tool — it shows A, AAAA, CNAME, MX, NS, TXT, and more for any hostname, so you can tell which names are live, which are parked, and which point somewhere unexpected. For a walkthrough of what each record type does, our DNS Lookup Explained guide covers the details. And for a broader read on a domain's configuration, the Domain Security Scorecard scores the DNS, email authentication, and TLS posture of any domain.
Methodology & Sources
Definitions and DNS mechanics are cited to IETF RFCs 1034, 4592, 5936, and 6962; takeover mechanics, impact, and prevention steps to the OWASP Subdomain Takeover Prevention Cheat Sheet and OWASP Web Security Testing Guide; federal expectation to CISA Emergency Directive 19-01; and cloud-specific guidance to Microsoft Learn. All facts verified November 2026 — current as of November 2026.
- RFC 1034 — Domain Names: Concepts and Facilities (RFC Editor)
- RFC 4592 — The Role of Wildcards in the Domain Name System (RFC Editor)
- RFC 5936 — DNS Zone Transfer Protocol (AXFR) (RFC Editor)
- RFC 6962 — Certificate Transparency (RFC Editor)
- OWASP — Subdomain Takeover Prevention Cheat Sheet
- OWASP WSTG — Test for Subdomain Takeover
- CISA Emergency Directive 19-01 — Mitigate DNS Infrastructure Tampering
- Microsoft Learn — Prevent Dangling DNS Entries and Avoid Subdomain Takeover
- crt.sh — Certificate Search (operated by Sectigo)