Skip to content Lockpick

Could someone take over a forgotten subdomain of yours?

If a DNS record on your domain still points at a service you stopped using, someone else may be able to claim that spot and control a real address on your domain, so delete records for services you no longer use. When you set up a new service, claim it on the provider first and create the DNS record last.

What is a subdomain takeover?

Your domain can have many subdomains, like shop. or help., each pointing to a service you use. When you stop using the service but leave the pointer, the address still points there. If someone else can then claim that spot on the service, they control a real address on your domain. That's called a subdomain takeover, and it's convincing because the address really is yours.

In DNS terms, the subdomain has a canonical name (CNAME) record, but no host is providing content for it.

It can happen when a virtual host is set up or removed without care. If you remove a virtual host from the hosting provider but don't remove the DNS entry that points to it, an attacker can create their own virtual host with that provider, claim your subdomain and host their own content under it. At setup, unless the provider verifies that whoever creates the virtual host owns the subdomain name, an attacker who is quicker than you could create one with your subdomain name first.

Why does it matter?

An attacker who holds your subdomain can potentially read cookies set from the main domain, perform cross-site scripting, or circumvent content security policies. That can let them capture protected information, including logins, or send malicious content to your users.

Lockpick rates a takeover finding high when the scan can see the address is free to claim. Whoever claims it serves pages on your real domain and receives cookies set for all of it. The report lists what to fix by how directly someone could use it, not by the severity label.

How do I check?

Start with your own DNS records. Open your DNS provider, list every CNAME record, and for each one confirm you still run something at the target.

Keep an inventory of all your domains and their hosting providers, and update it as things change, so nothing is left dangling.

A Lockpick scan lists subdomains that point to other companies and says which ones look unclaimed or about to expire. Reading DNS records, certificate logs and domain registration never touches your site.

For the neighbouring cases, see the subdomains run by other companies and expiring domains your subdomains rely on checks.

Check your site

How do I fix it?

Say Atlas, our example app at atlas.example, once ran a docs site at docs.atlas.example on a hosting service and later shut it down. The DNS record still points at the hosting service, and nothing is there. These are the steps Atlas would follow, and they work the same for your site.

  1. Find the record. In your DNS provider, open the record for the flagged subdomain and note which service it points to.
  2. Decide whether you still use that service. If nobody on your team can name what runs there, treat it as unused.
  3. Delete the record if you don't need it. If the subdomain has already been taken over, the first step, if possible, is to remove its DNS entry. Lockpick never changes anything on your site, your DNS or your accounts, so this step is yours.
  4. Reclaim before you repoint. If you still need the service, recreate or reclaim the resource at the provider before you touch DNS. Claim the virtual host first and create DNS records last.
  5. Check every layer. If your site has more than one layer, such as a CDN in front of virtual hosting, you may need to examine each layer to see where the attacker claimed your subdomain.
  6. Check again. Run a new scan once the DNS change has spread. A finding is never marked fixed because a ticket was closed or a task was ticked.
  7. Stop it happening again. Define standard processes for provisioning and deprovisioning hosts, and do all steps as closely together as possible. Look through your DNS records now and then and delete any that point to services you no longer use. Ask your hosting vendors how they verify that someone claiming a virtual host actually has a legitimate claim to the domain name.

If you want help from a coding assistant, paste one of these.

Fix prompt for any coding agent
A security scan flagged a subdomain of mine as pointing at a service that looks unclaimed. Here is the subdomain and target from the report [paste them]. Help me clean it up. First, tell me which DNS record to look at and which provider it points to. Ask me whether I still use that service. If I don't, give me the exact record to delete at my DNS provider and nothing else. If I do, walk me through recreating or reclaiming the resource at that provider before I touch DNS. Do not suggest creating any new DNS record until the resource is claimed and mine.
Fix prompt for Claude Code
Search this repository for DNS or domain configuration, such as infrastructure files or deploy settings, that defines [paste the subdomain from the report]. Show me the record and what it points to. If the target service is no longer used anywhere in the code, propose a change that removes the record, explain what it removes, and wait for my approval before applying it. Do not add or change any other DNS records. Then list every other CNAME record you found with its target so I can confirm each one is still in use.

What a check cannot tell you

A Lockpick report is not a certificate and not a full penetration test. It covers what that scan could see on that day.

Anything a scan couldn't check is marked as not checked, never as passed. When part of a finding was inferred rather than seen, the finding is marked needs review and says which part is still open.

Don't read a clean result as proof that every subdomain is safe. Keep your own list of subdomains and their providers, and compare it with the report.

Don't read a finding as proof that someone has already claimed the address either. Look at what the subdomain serves today, and if it shows content you didn't publish, remove the DNS entry first.

Questions people ask

Is a subdomain takeover the same as a lookalike domain?

No. With a lookalike, someone registers a name one letter away from yours, or the same name with a different ending. A takeover uses a real address on your own domain, and it's convincing because the address really is yours.

Should I delete the DNS record or recreate the service?

Delete the record if you no longer use the service. If you still need it, reclaim the resource at the provider first. Claim the virtual host first and create DNS records last.

Does Lockpick touch my site or DNS to run this check?

Reading DNS records, certificate logs and domain registration never touches your site. Lockpick never changes anything on your site, your DNS or your accounts.

What could someone do with a subdomain they took over?

An attacker who holds your subdomain can potentially read cookies set from the main domain, perform cross-site scripting, or circumvent content security policies. That can let them capture protected information, including logins, or send malicious content to your users.

See what your site shows from outside

A quick check reads your homepage the way a visitor would and gives you a score. No account needed.

Check your site

Sources

  1. How we check · Docs · Lockpick Lockpick docs, read on November 5, 2026
  2. How we rate findings · Docs · Lockpick Lockpick docs, read on November 5, 2026
  3. Lookalike domains and why they matter · Docs · Lockpick Lockpick docs, read on November 5, 2026
  4. Subdomain takeover - Security | MDN MDN Web Docs, read on November 5, 2026
  5. What we never do · Docs · Lockpick Lockpick docs, read on October 29, 2026

About the author

I'm Mark, founder of Lockpick. These pages are drafted with AI and checked against their cited sources before publication. The Updated date changes only when the page itself does.