Skip to content

Configuring Route 53 with security and DNS best practices

How to structure zones, records, and email protection in Route 53 to reduce exposure, subdomain takeover, and delivery failures.

Reading time
12 min
Published

Route 53 is the managed DNS service from AWS. Since almost every access to a domain starts with a DNS query, a configuration mistake there hits availability and email delivery, and some mistakes open a security gap. The problem is that misconfigured DNS rarely shows up in a traditional scanner, which is why it ranks among the most common causes of silent incidents. Think of a record that points to a resource that no longer exists, an orphaned subdomain that someone can take over, or an SPF record that lets any server send email on behalf of the domain.

In Route 53, most problems come from a handful of decisions: how the hosted zones are organized, which records exist and where they point, which authorities can issue certificates for the domain, and how email is protected with SPF, DKIM, and DMARC. On top of that come the choice of whether to enable DNSSEC and the access control over who can change the zone, with every change logged for audit. The goal is a domain that keeps resolving with the smallest possible risk surface, and a configuration that still makes sense to whoever audits it much later, when nobody remembers why each record was created.

Hosted zones: public and private

A public hosted zone answers queries that come from the internet, while a private zone only answers inside the VPCs associated with it. Mixing the two roles is a common mistake, and the result shows up in two ways: internal names exposed to the public, or public records that stop resolving inside the network. So draw a clear line between what is internal and what is external, and associate the private zone only with the VPCs that actually need it.

For internal names, avoid reusing the public domain. A subdomain reserved for internal use lowers the chance of leaking your topology and the names of sensitive services through DNS queries, which often end up recorded in third-party logs. Sometimes the same name has to resolve from inside and from outside with different answers. In that case, the standard pattern is split-horizon: a private zone and a public zone for the same domain, each holding the records for its own context.

In environments with several accounts, a private zone can be associated with VPCs in other accounts through Resource Access Manager. That centralizes internal resolution without duplicating zones. The thing to watch is keeping the association limited to the accounts that really need to resolve those names, because every extra account widens the reach of the internal zone.

TTL and propagation

A high TTL keeps answers in cache longer and lowers query costs. The problem appears when you need to change something (a migration or a failover): until the old TTL expires, resolvers keep handing out the old address. So before a planned migration, lower the TTL ahead of time (to 60 seconds, for example) and only then make the switch. Once everything is stable, raise the TTL again. Note that you have to lower it at least one old TTL in advance, since resolvers only fetch the new value when their cache expires.

Essential records and the CAA record

Much of DNS security comes down to choosing the right record type. To point the root of the domain to an AWS resource (CloudFront, an ALB, or a static website bucket), use an alias record instead of a CNAME. An alias works at the zone apex, resolves straight to the resource without an extra query hop, and follows the service's address changes on its own. A CNAME, on the other hand, cannot exist at the root and adds a step to resolution.

The CAA record is still underused. It declares which certificate authorities may issue certificates for the domain. Without it, any public CA can issue a valid certificate for your name, which raises the risk of improper issuance. With CAA published, you limit issuance to the authorities you actually use (Amazon's, in the case of ACM) and can also get notified of attempts that fall outside the policy, as in this example:

CAA record restricting certificate issuance
CAA  @   0 issue "amazon.com"CAA  @   0 issuewild "amazon.com"CAA  @   0 iodef "mailto:security@your-domain"

Replace the authority in the example with the one that issues your certificates, and include every legitimate CA before publishing. If one is left out, its next renewal will be refused. The iodef field sets the address where the CA sends reports of attempts that violate the policy, and that is how you find out about an unexpected issuance request.

Email protection: SPF, DKIM, and DMARC

Most domain abuse starts with forged email, and the defense depends on three records working together. SPF declares which servers may send on behalf of the domain, and DKIM signs the messages. DMARC sets the handling policy when SPF or DKIM fails, and it is also what turns on reporting.

Sample TXT records (adjust them for your email provider)
TXT  @            "v=spf1 include:_spf.your-provider.com -all"TXT  _dmarc       "v=DMARC1; p=quarantine; rua=mailto:dmarc@your-domain; fo=1"TXT  selector._domainkey   "v=DKIM1; k=rsa; p=DKIM_PUBLIC_KEY"

Start DMARC at p=none, just to collect reports. Review the legitimate sources that show up, and only then move to quarantine and, later, to reject. Teams that jump straight to reject without reading the reports tend to block legitimate email from forgotten systems, such as billing or some internal tool that sends messages on behalf of the domain.

Alignment, reports, and parked domains

DMARC only treats a message as authenticated when there is alignment, that is, when the domain shown in the From field matches the domain validated by SPF or DKIM. That is why publishing SPF alone does not solve the problem: without alignment, the sender can still be spoofed. Aggregate reports arrive at the address set in rua and show which sources send on behalf of the domain. They reveal both legitimate services that nobody remembered and abuse attempts.

Domains and subdomains that do not send email need protection too. Publish on them an SPF record that rejects every source and a DMARC record set to reject, so nobody can forge messages from a parked domain. It is a simple change, and one of the most effective ones for protecting the brand.

DNSSEC: when to enable it

DNSSEC signs DNS responses and protects against cache poisoning and forged answers. In Route 53 you turn it on zone by zone, it uses a key-signing key (the KSK) stored in KMS, and it is only complete once you publish the DS record at the domain registrar. That record closes the chain of trust. The protection is real, but it demands a key management routine: a KSK failure or an outdated DS record can leave the whole domain unresolvable for resolvers that validate signatures.

Not every TLD supports DNSSEC, and the protection only applies to resolvers that validate signatures. That is why it makes the most sense on critical, high-value domains, enabled as a planned and monitored change, with alerts for signature expiration. In many cases, well-configured SPF, DKIM, DMARC, and CAA deliver a bigger gain with less operational risk.

Orphaned subdomains and takeover

The most underestimated DNS risk is the orphaned subdomain. It works like this: a record (usually a CNAME) points to a resource that was removed, such as a bucket, a CloudFront distribution, or a SaaS account that was deprovisioned. The target address is now free for anyone to claim. If an attacker creates that same resource, they start answering for your subdomain and can use it for very convincing phishing, since the page is served from a name that really is yours.

The defense is keeping an inventory and being disciplined about removals. When you decommission a resource, delete the record that points to it first and only then the resource, in that order. Every so often, review the zone by matching each record against the resources that actually exist, with special attention to CNAMEs that point to third-party services. Route 53 Resolver query logging also helps, because it shows which names still receive queries, and that guides both the cleanup and any investigation.

Access control, failover, and auditing

DNS is critical infrastructure, so the group of people who can change it should be small. Keep the permission to change records to the minimum needed, ideally scoped to specific zones, and treat every change as one that goes through review. Every Route 53 operation is recorded in CloudTrail. That lets you reconstruct who changed what and when, which is exactly the information you will look for when investigating a suspicious configuration.

On the availability side, Route 53 offers health checks tied to routing policies. With failover, traffic moves to a secondary target when the primary becomes unavailable. With latency-based or weighted routing, you spread the load and can run gradual migrations. If the query logs are also sent for analysis, the same features that give you resilience start helping you detect anomalous resolution patterns.

Practical checklist

  • Separate public and private zones, and associate the private zone only with the VPCs that need it
  • Use alias records instead of CNAMEs for AWS resources, especially at the domain root
  • Publish a CAA record listing the authorities allowed to issue certificates for the domain
  • Lower the TTL before planned migrations and restore the normal value afterward
  • Publish an SPF record ending in -all and review its includes
  • Set up DKIM with your own selector and a planned key rotation
  • Start DMARC at p=none and move to quarantine or reject only after reading the reports
  • Protect parked domains with SPF -all and DMARC set to reject
  • Evaluate DNSSEC for critical domains, with the key management routine defined up front
  • Remove records that point to resources that no longer exist (orphaned subdomains)
  • Turn on Resolver query logging to support inventory and detection
  • Restrict in IAM who can change records, and track changes through CloudTrail
  • Use health checks for failover on critical records
  • Write down what each relevant record is for

Best practices

  • Treat DNS changes as critical changes, with review and a record of each one
  • At the domain root, point to AWS resources with an alias instead of a CNAME
  • Manage all your domains in one place and standardize record names
  • Track the expiration of the domain and of the certificates tied to it
  • Grant route53:ChangeResourceRecordSets only to the people who really need it
  • Keep an inventory of your subdomains and of the resources each one points to

Common mistakes

Permissive SPF with ~all, or more than one SPF record on the domain
It makes domain spoofing easier, and more than one record can invalidate SPF evaluation, which hurts delivery and reputation.
CNAME pointing to a resource that was already removed
It opens the door to subdomain takeover, and the subdomain ends up serving convincing phishing under your domain.
TTL set too high during a migration
Changes and failover take longer to propagate, and the outage lasts longer than it had to.
Internal names in a public zone
Your topology and the names of sensitive services become visible in public queries and logs.
DNSSEC enabled without a key management routine
A KSK failure can leave the whole domain unresolvable.

Authorship and review

Cesar Gargiulo

CEO and founder of GUARDIASEC. Technical and editorial lead for the content published in this library.

Published on . Found a technical error? Write to [email protected] and we will correct it and keep a record of the change.

Frequently asked questions

Does Route 53 protect against DNS attacks on its own?
No. Route 53 is resilient and highly available, but protection depends on configuration. What reduces spoofing, subdomain takeover, and forged answers is correct records, SPF, DKIM, DMARC and, where it makes sense, DNSSEC. The service provides the infrastructure, and your security posture comes from the way you configure the zone.
Do I need DNSSEC on every domain?
No. DNSSEC protects against forged answers, but it requires key management and increases operational risk when it is poorly managed. It makes the most sense on critical, high-value domains. In many cases, well-configured SPF, DKIM, and DMARC already bring the biggest security gain for email.
How do I find orphaned subdomains?
List the records in the zone and check, one by one, whether each target still exists. Pay special attention to CNAMEs that point to buckets, distributions, and third-party services. Any record that points to a removed resource should be deleted, and a periodic review of that inventory is what prevents subdomain takeover.
What is the difference between an alias and a CNAME in Route 53?
An alias is an AWS-specific record type that points to resources such as CloudFront, ALB, and S3. It works at the domain root and does not generate an extra billed query. A CNAME cannot be used at the root and adds a hop to resolution. For AWS resources, use an alias.
What is the CAA record for, and should I publish it?
The CAA record defines which certificate authorities may issue certificates for your domain. Without it, any public CA can issue a valid certificate for your name, which raises the risk of improper issuance. It is worth publishing on almost every domain. List the authorities you actually use and add the iodef field to get notified of attempts outside the policy. The catch is that you must include every legitimate CA before publishing, or a renewal may be blocked.
How do I set up DNS failover in Route 53?
You create health checks that monitor the target and associate them with records that use the failover routing policy. While the primary responds well, Route 53 returns its address. When the health check fails, it starts answering with the secondary. A low TTL on these records makes the switch propagate faster. If the idea is to spread load or prepare migrations, latency-based and weighted policies complete the design.

When to bring in specialist help

When the environment has many domains, complicated email integrations, or subdomains inherited from old projects, a structured review is worth the effort. GUARDIASEC assesses DNS configuration, exposure, and edge protection as part of its AWS and cloud security service, and remediation starts with what actually reduces risk.