Ruachost

DNSSEC, DMARC, SPF & DKIM: A Guide to Layered Domain Security

Learn about DNSSEC, DMARC, SPF, and DKIM to secure your domain from spoofing and phishing in our comprehensive guide on layered domain security.

Ruachost Editorial18 November 2026 10 min read
DNSSEC, DMARC, SPF & DKIM: A Guide to Layered Domain Security

Domain security is not one setting or a single DNS record. Attackers can target DNS resolution, forge the visible sender on an email, alter messages in transit, or exploit forgotten third-party sending services. Effective protection therefore requires several controls working together.

DNSSEC protects the integrity of DNS responses. SPF identifies approved sending systems, DKIM adds a verifiable signature to email, and DMARC connects those checks to the address recipients actually see. This guide explains how these technologies complement one another and how to deploy them without disrupting legitimate traffic.

Introduction to Domain Security#

Your domain is a foundation for websites, email, customer portals and online identity. If attackers can impersonate or redirect it, they may be able to:

  • Send convincing phishing messages that appear to come from your organisation.
  • Redirect visitors to a fraudulent website through poisoned DNS responses.
  • Abuse your brand in invoice fraud and credential-theft campaigns.
  • Damage your email reputation and cause legitimate messages to be marked as spam.
  • Modify email authentication records to weaken existing protections.

No protocol addresses every risk. DNSSEC secures DNS data, while SPF, DKIM and DMARC authenticate email sent using your domain.

Protocol

Protects

Main defence

Does not provide

DNSSEC

DNS responses

Cryptographic DNS signatures

Traffic encryption

SPF

Sending infrastructure

Approved servers and IP addresses

Message integrity

DKIM

Email content and signing domain

Cryptographic email signature

Delivery policy

DMARC

Visible sender identity

Alignment, policy and reporting

DNS integrity

Together, these controls create layers: trustworthy DNS records support email authentication, while DMARC turns SPF and DKIM results into an enforceable policy.

Understanding DNSSEC: Benefits and Implementation#

The Domain Name System translates names such as example.com into the addresses and records needed to reach websites and mail servers. Traditional DNS was not designed to prove that a response is authentic.

DNS Security Extensions, or DNSSEC, add cryptographic signatures to DNS zones. A validating resolver can use those signatures to confirm that a record came from the correct zone and was not modified in transit. ICANN explains that this protects against attacks such as DNS cache poisoning, in which a forged answer directs users to the wrong destination.

DNSSEC can validate records including:

  • A and AAAA records for websites and services.
  • MX records that direct incoming email.
  • TXT records containing SPF, DKIM and DMARC policies.
  • CAA records controlling which certificate authorities may issue certificates.
  • Other signed records published within the zone.

This is especially relevant to email authentication. SPF, DKIM and DMARC depend on DNS records. DNSSEC helps a validating resolver detect forged or altered versions of those records.

However, DNSSEC does not encrypt DNS requests, conceal browsing activity or determine whether a website is trustworthy. HTTPS remains necessary to encrypt web traffic, while access controls and registrar security remain essential for preventing unauthorised DNS changes.

How DNSSEC is enabled#

DNSSEC establishes a chain of trust between a domain’s signed zone and its parent zone. The DNS provider signs the zone, and a Delegation Signer, or DS, record is placed at the parent through the registrar.

The usual process is:

  1. Confirm that the registrar and authoritative DNS provider support DNSSEC.
  2. Enable zone signing at the authoritative DNS provider.
  3. Obtain the required DS details if they are not submitted automatically.
  4. Publish the DS record through the registrar.
  5. Validate the chain of trust before considering deployment complete.

Ruachost supports DNSSEC for .com and .ng domains, with activation available through the client area. Because incorrect or stale DS records can make a domain unreachable to validating resolvers, migrations between DNS providers must be planned carefully. Remove or replace old trust information at the correct stage rather than changing name servers without coordinating DNSSEC.

You can inspect the DNSSEC chain with this command:

Terminal
dig +dnssec example.com A

A response containing authenticated data indicates successful validation when the query is made through a validating resolver. Administrators should also test key rollovers and monitor for expired signatures or broken delegation.

Email Security with DMARC, SPF, and DKIM#

SPF, DKIM and DMARC have different but complementary responsibilities.

SPF: authorising sending systems#

Sender Policy Framework lets a domain publish the servers permitted to send email using its envelope sender domain. A receiving server compares the connecting IP address with the domain’s SPF policy.

A simple SPF record may look like this:

Output
example.com. IN TXT "v=spf1 ip4:203.0.113.10 -all"

The record authorises 203.0.113.10 and treats other sources as unauthorised. Real deployments may require approved third-party platforms, but every inclusion should be understood and documented.

A domain must publish only one SPF record. Administrators must also respect SPF’s limit of ten mechanisms or modifiers that cause DNS lookups. Excessive include, a, mx and redirect use can produce a permanent error rather than a useful authentication result.

SPF also has an important limitation: forwarding can cause a failure because the forwarder’s server may not be authorised by the original sender’s record.

DKIM: signing outgoing messages#

DomainKeys Identified Mail uses public-key cryptography. The sending service signs selected headers and the message body using a private key. The receiving server obtains the corresponding public key from a DNS record such as:

Output
mail2026._domainkey.example.com. IN TXT "v=DKIM1; k=rsa; p=PUBLIC_KEY_DATA"

Here, mail2026 is the selector. Selectors allow a domain to maintain multiple keys and rotate them without immediately removing the previous key.

A valid signature shows that the signed content has not been altered and that the signer controlled the relevant private key. DKIM often survives forwarding better than SPF, although mailing lists or security gateways that modify signed content can invalidate it.

Private keys must remain on authorised sending systems and should never be published in DNS. Use strong keys supported by the email platform, rotate them periodically, and retain an old public key long enough to verify messages still in transit.

DMARC: alignment, policy and visibility#

DMARC evaluates whether SPF or DKIM passes and aligns with the domain in the visible From header. This alignment matters because an attacker might pass SPF using one domain while displaying an unrelated trusted domain to the recipient.

A monitoring record could be:

Output
_dmarc.example.com. IN TXT "v=DMARC1; p=none; rua=mailto:dmarc-reports@example.com"

DMARC has three principal policies:

Policy

Receiver instruction

Recommended stage

p=none

Monitor without requesting blocking

Initial discovery

p=quarantine

Treat failures as suspicious

Controlled enforcement

p=reject

Refuse failing messages

Full enforcement

Starting with p=none is useful for discovering legitimate senders, but it is not the final protection. The objective should be a carefully tested move to quarantine and then reject.

Aggregate reports sent to the rua address reveal which systems claim to send for the domain, their authentication results and alignment status. Because reports are machine-readable XML, organisations commonly process them with a trusted reporting system rather than reading each file manually.

Preventing Phishing and Email Spoofing#

Spoofing occurs when an attacker makes a message appear to originate from a trusted domain. Phishing uses that false identity to persuade someone to disclose credentials, approve a payment or open malicious content.

The layered controls interrupt different parts of this attack:

  1. SPF identifies mail arriving from an unauthorised sending system.
  2. DKIM verifies the signature and detects changes to signed content.
  3. DMARC checks whether the passing domain aligns with the visible sender.
  4. DNSSEC protects the authenticity of the DNS data used for those checks.

For example, an attacker may send from an unauthorised server while putting accounts@example.com in the visible sender field. SPF can fail the attacker’s envelope domain, while DMARC detects that no aligned SPF or DKIM result supports example.com. Under p=reject, the receiver is asked not to accept the message.

These protocols substantially reduce direct domain spoofing, but they do not stop every phishing technique. Attackers may register lookalike names, compromise a genuine mailbox or use a trusted platform account. Domain owners should also use multifactor authentication, registrar locks, role-based DNS access, employee awareness training and monitoring for confusingly similar domains.

Real-World Examples of Domain Security Breaches#

Many domain incidents follow recurring patterns rather than sophisticated cryptographic attacks.

Failure

Typical incident

Security layer that helps

Poisoned DNS cache

Visitors reach a fraudulent server

DNSSEC

Unauthorised mail server

Attacker sends with the domain in the envelope

SPF

Modified message

Content changes after signing

DKIM

Forged visible sender

Phishing displays a trusted From address

DMARC

Compromised mailbox

Genuine account sends malicious mail

MFA and account security

The last row is important: an authenticated malicious message from a compromised account may pass SPF, DKIM and DMARC. Authentication confirms the technical origin; it does not guarantee that the person controlling the account is trustworthy.

Adoption also varies widely between technologies. A European Commission Joint Research Centre analysis found relatively high uptake of SPF, DKIM, DMARC and STARTTLS in its EU dataset, but DNSSEC and DNSSEC-dependent DANE remained around 2–5%. The JRC findings illustrate why email authentication should not be mistaken for complete domain protection.

Operational mistakes create another common breach path. A forgotten marketing service may be omitted from SPF, an expired DKIM key may break signatures, or an organisation may leave DMARC permanently at p=none. Conversely, broad authorisations can allow systems that no longer need access to continue sending as the domain.

Practical Guide to Implementing Layered Security#

Deployment should begin with discovery, not enforcement. The Canadian Centre for Cyber Security’s implementation guidance recommends identifying domains and authorised senders before moving toward stronger controls.

1. Inventory domains and email sources#

List primary domains, parked domains and subdomains. Identify every system sending email, including:

  • Employee mailboxes.
  • Website contact forms.
  • Transactional applications.
  • Billing, support and marketing platforms.
  • Monitoring devices and internal systems.

Domains that never send email should still receive defensive SPF and DMARC policies so attackers cannot exploit them.

2. Publish and validate SPF#

Create one SPF record covering all legitimate senders. During testing, a soft-fail policy may be appropriate:

Output
example.com. IN TXT "v=spf1 ip4:203.0.113.10 ~all"

Once the inventory is complete and failures have been investigated, consider changing ~all to -all. Do not copy an SPF record from another domain; its authorisations and dependencies may be inappropriate.

Check the published record with this command:

Terminal
dig TXT example.com

3. Enable DKIM everywhere#

Generate separate selectors where practical for major sending services. Confirm that outgoing messages contain a DKIM-Signature header and that the signing domain aligns with the visible sender domain.

Check a selector’s public key with this command:

Terminal
dig TXT mail2026._domainkey.example.com

Document key ownership and rotation dates. Remove abandoned selectors after old messages no longer require them.

4. Introduce DMARC gradually#

Publish DMARC with reporting enabled, monitor the results and resolve unknown sending sources. Then move to enforcement:

Output
_dmarc.example.com. IN TXT "v=DMARC1; p=quarantine; rua=mailto:dmarc-reports@example.com; pct=100"

After confirming that legitimate mail consistently passes aligned SPF or DKIM, change the policy to p=reject. Decide whether subdomains need a separate policy or an sp tag in the organisational domain’s record.

5. Enable DNSSEC and maintain every layer#

Coordinate DNSSEC activation between the DNS host and registrar, then test the complete chain. At Ruachost, eligible .com and .ng domains can enable DNSSEC through the client area.

Security then becomes an ongoing process. Review DMARC reports, remove retired SPF sources, rotate DKIM keys, monitor DNSSEC validity and require multifactor authentication for registrar, hosting and email administrator accounts. Recheck authentication after changing a DNS provider or email platform.

Conclusion: Securing Your Digital Presence#

DNSSEC, SPF, DKIM and DMARC are strongest as a coordinated system. DNSSEC protects the integrity of DNS answers; SPF limits approved sending infrastructure; DKIM verifies signatures and message integrity; and DMARC aligns authentication with the visible sender while providing reports and enforcement.

Begin with a complete inventory, deploy each control carefully, and move from monitoring to enforcement only after legitimate services have been verified. Continue protecting registrar and mailbox accounts, because authentication records cannot compensate for stolen administrative credentials.

Ready to strengthen your domain and email security? Visit Ruachost to manage your domain, hosting and supported DNSSEC settings from one place.

Found this useful? Share it.

Keep reading

More from the blog.