How to Prevent Subdomain Takeover
Detects unclaimed subdomains pointing to external services.
What This Check Detects
Detects unclaimed subdomains pointing to external services.
Full Documentation
What is Subdomain Takeover?
Subdomain takeover occurs when a DNS record points to an external service (like Heroku, AWS, or GitHub Pages) that you no longer control. Attackers can claim the service and serve malicious content on your subdomain.
Security Impact
Severity: High
- Phishing attacks using your domain
- Malware distribution
- Reputation damage
- SEO poisoning
- Session hijacking
How to Fix
1. Audit DNS Records
# List all DNS records
dig yourdomain.com ANY
# Check specific subdomain
dig subdomain.yourdomain.com
# Check CNAME records
dig subdomain.yourdomain.com CNAME
2. Remove Dangling DNS Records
Remove CNAME records pointing to services you no longer use:
# Vulnerable
blog.yourdomain.com CNAME myblog.herokuapp.com
# If you deleted the Heroku app, remove this DNS record!
3. Monitor Common Services
Services vulnerable to takeover:
- Heroku:
*.herokuapp.com - GitHub Pages:
*.github.io - AWS S3:
*.s3.amazonaws.com - Azure:
*.azurewebsites.net - Shopify:
*.myshopify.com
4. Verify Subdomains
# Check if subdomain resolves
nslookup app.yourdomain.com
# Check what it points to
dig app.yourdomain.com CNAME
5. Implement CAA Records
# DNS CAA record
yourdomain.com. CAA 0 issue "letsencrypt.org"
yourdomain.com. CAA 0 issuewild ";"
Prevention
- Document all subdomains
- Before deleting services, remove DNS records
- Regular DNS audits
- Use DNS monitoring tools
- Implement DNS CAA records
Verification Steps
- List all DNS records
- Verify each CNAME resolves correctly
- Check for orphaned records
- Test subdomain accessibility
- Use automated scanners
Tools
dig,nslookup- DNS queries- can-i-take-over-xyz - Service fingerprints
- Security scanners with subdomain takeover detection
Related Issues
- DNS Security
- Email Security
How to Fix This Issue
Dangling DNS records pointing to decommissioned services allow attackers to take over your subdomains. Learn how to find and fix them.
Read the full fix guideRelated Security Checks
Is your Laravel app exposed right now?
34% of Laravel apps we scan have at least one critical issue. Most teams don't find out until something breaks. Our free scan checks your live application in under 60 seconds.