How it happens
promo.example.comis a CNAME topromo-site.cloudhost.example.- The campaign ends and the cloud resource is deleted. The CNAME stays.
- Someone registers
promo-siteon the same cloud service. Your subdomain now shows their page, can set cookies for your domain, and can pass a certificate authority's domain check.
The same applies to NS records delegating a subdomain to a DNS service where the zone was deleted, and to MX records pointing at a mail service you left.
Finding them
Follow every CNAME to its end. A target that returns NXDOMAIN is dangling. A target that resolves but shows the provider's "no such site" page may also be claimable; services publish what that page looks like, and the open-source community keeps a list of known fingerprints.
Certificate transparency logs and old DNS exports help find subdomains you forgot about; DNS itself cannot list them.
Removing them in the right order
Delete or change the DNS record first, then delete the cloud resource. Removing a record is a high-risk change in our product: it always needs a person's approval, and it is verified afterwards by confirming the name no longer points at the old target.