Interview Prep/Real-World Interview/DNS, TLS and certificates

Security reports that `promo.example.com` is serving a crypto-scam page you never published.

AdvancedTroubleshootingDNS, TLS and certificates
Answer

Likely causes → Subdomain takeover. A DNS record still points at a resource you deleted (an S3 website bucket, an Azure App Service, a Heroku app, a CloudFront distribution) and someone else claimed that name on the provider.

Diagnose →

dig +short promo.example.com CNAME
curl -sI http://promo.example.com | head

A CNAME to promo-bucket.s3-website.ap-south-1.amazonaws.com or promo.azurewebsites.net that you don't own confirms it.

Fix → Delete the dangling DNS record immediately. Treat it as a security incident: check whether the page harvested credentials or cookies scoped to .example.com, and rotate sessions if needed.

Prevent → Delete DNS records in the same change that deletes the resource (same Terraform module), use ALIAS records to AWS resources where possible, and run a scheduled scan that flags DNS records pointing at non-existent cloud resources.

All Real-World Interview questions Roadmap: Interview readiness

More on DNS, TLS and certificates