Skip to content
Hosting Operations5 min read

DNS Not Resolving: 5 Fixes & Security Hardening

Fix DNS not resolving errors by checking TTLs, cache, and zone files. Secure your resolver against cache poisoning and unauthorized zone transfers.

Written by Abdul AbrorTechnical Hosting Support Engineer
Red error messages on a black computer screen indicating blocked web resources
On this page

TL;DR — Key takeaways

  • Clear local and router DNS caches before assuming a zone file error.
  • Verify TTL values and propagation status using dig or nslookup.
  • Disable zone transfers to unauthorized IPs to prevent data leakage.
  • Enable DNSSEC validation on resolvers to protect against cache poisoning.
  • Restrict resolver access to internal networks only if possible.

DNS not resolving is a common issue that can stem from simple cache problems or deeper security misconfigurations. In support tickets I handled, the usual culprit was a full disk or a misconfigured resolver, but sometimes it's a sign of a more serious threat.

This guide walks you through practical fixes and security hardening steps. You'll learn how to diagnose the problem, apply the right fix, and verify your configuration is secure against common attacks.

Diagnosing the Root Cause

Start by checking if the issue is local or global. Run `nslookup example.com` on your machine. If it fails, try `nslookup example.com 8.8.8.8` to bypass your local resolver. If that works, the problem is with your local DNS configuration or cache.

Check your `/etc/resolv.conf` file. Ensure the `nameserver` entries point to valid, reachable IPs. A common mistake is leaving an old, decommissioned nameserver in the list. The resolver will time out trying to reach it before falling back to the next one.

  • Use `dig +trace example.com` to see the full resolution path.
  • Check for typos in domain names or subdomains.
  • Verify that the domain is actually registered and active.

Fixing Common Resolution Errors

If the domain resolves on other networks but not yours, flush the local DNS cache. On Linux, restart `systemd-resolved` or `nscd`. On Windows, use `ipconfig /flushdns`. On macOS, use `sudo dscacheutil -flushcache`.

If the issue persists, check the TTL (Time To Live) of the DNS records. A high TTL means changes take longer to propagate. You can temporarily lower the TTL before making changes to speed up propagation. Remember to restore the original TTL after the change is live.

  • Restart the DNS service on the server if you're the authoritative host.
  • Check for firewall rules blocking UDP port 53.
  • Verify that the DNS server is not overloaded or experiencing high latency.

Threat Model: What Can Go Wrong?

DNS is a critical infrastructure component, and misconfigurations can lead to serious security issues. The main threats include cache poisoning, where an attacker injects fake DNS records into your resolver's cache. This can redirect users to malicious sites.

Another threat is unauthorized zone transfers. If your DNS server allows zone transfers to any IP, an attacker can download your entire DNS zone file. This exposes internal hostnames, IP addresses, and other sensitive information.

Finally, DNS amplification attacks can be used to flood your server with traffic. If your resolver responds to open queries, it can be used as a reflector in a DDoS attack.

  • Cache poisoning can lead to man-in-the-middle attacks.
  • Zone transfer leaks can expose internal network topology.
  • Open resolvers can be abused for DDoS amplification.

Hardening Your DNS Configuration

Start by restricting zone transfers. In your BIND configuration, use the `allow-transfer` directive to specify only the IPs of your secondary nameservers. For example, `allow-transfer { 192.168.1.10; 192.168.1.11; };`. This prevents unauthorized access to your zone data.

Enable DNSSEC on your authoritative servers. This adds cryptographic signatures to your DNS records, allowing resolvers to verify their authenticity. Use `dnssec-signzone` to sign your zone files. Ensure your resolvers are configured to validate DNSSEC responses.

Restrict resolver access. If your DNS server is only for internal use, bind it to your internal network interface. Use `listen-on` in your BIND configuration to specify the IP address. This prevents external attackers from querying your resolver directly.

  • Use `allow-query` to restrict which IPs can query your resolver.
  • Enable rate limiting to mitigate amplification attacks.
  • Keep your DNS software updated to patch known vulnerabilities.

Verifying Security and Performance

After applying hardening steps, verify your configuration. Use `dig axfr example.com @your-dns-server` to test zone transfers. It should fail unless you're querying from an authorized IP. If it succeeds, your restrictions are not working.

Check DNSSEC validation with `dig +dnssec example.com`. Look for `RRSIG` records in the output. If you see them, DNSSEC is working. You can also use online tools like the DNSSEC Analyzer to validate your setup.

Monitor your DNS logs for unusual activity. Look for spikes in query volume or repeated failed lookups. These can be signs of an attack or misconfiguration. Set up alerts for these events in your monitoring system.

  • Test zone transfer restrictions from an unauthorized IP.
  • Validate DNSSEC signatures with dig or online tools.
  • Review DNS logs for anomalies and set up alerts.

Quick troubleshooting checklist

  • Flush local DNS cache on client and server.
  • Check /etc/resolv.conf for correct nameserver entries.
  • Verify zone file syntax and SOA records.
  • Test zone transfer restrictions with dig axfr.
  • Enable and validate DNSSEC on authoritative servers.

FAQ

Why does DNS not resolving happen after a server migration?

It usually occurs because the new server's IP is not yet propagated, or the old TTL is still cached locally. Wait for the TTL to expire or flush the cache manually.

Is it safe to allow zone transfers to any IP?

No. Allowing zone transfers to any IP exposes your DNS records to the public. Restrict transfers to specific secondary nameserver IPs only.

How do I verify if DNSSEC is working?

Use dig +dnssec example.com to check for RRSIG records. If the output shows valid signatures, DNSSEC is functioning correctly.