← All guides

DNS Monitoring: Resolution Time and Failures with dig

Updated:

DNS Monitoring: Resolution Time and Failures with dig

DNS performance monitoring is essential for ensuring fast and reliable domain name resolution. This comprehensive guide covers everything you need to know about monitoring DNS query performance, detecting DNS failures, and optimizing DNS resolution speed.

For troubleshooting DNS issues, see DNS Resolution Failures and Timeout. For monitoring DNS query times, see Monitor DNS Query Response Times.

Why DNS Performance Monitoring Matters

DNS resolution is the first step in every web request. Slow DNS resolution causes delayed page loads, while DNS failures prevent access to services entirely. Monitoring DNS performance ensures fast resolution and early detection of DNS issues.

Effective DNS monitoring enables you to:

  • Track DNS query response times
  • Detect DNS resolution failures
  • Monitor DNS server availability
  • Identify DNS performance degradation
  • Ensure reliable domain name resolution
  • Optimize DNS configuration

Key DNS Metrics to Monitor

Performance Metrics

  • Query Response Time: Time to resolve domain names
  • Query Success Rate: Percentage of successful queries
  • Query Failure Rate: Percentage of failed queries
  • DNS Server Response Time: Time for DNS server to respond

Availability Metrics

  • DNS Server Availability: DNS server uptime
  • Resolution Success: Successful domain resolution
  • NXDOMAIN Errors: Non-existent domain errors
  • Timeout Errors: DNS query timeouts

Method 1: Monitor DNS Performance with dig Command

Check DNS Query Time

# Measure DNS query time
dig example.com +stats

# Query specific DNS server
dig @8.8.8.8 example.com +stats

# Check query time only
dig example.com +noall +stats | grep "Query time"

# Compare query times from different DNS servers
dig @8.8.8.8 example.com +stats | grep "Query time"
dig @1.1.1.1 example.com +stats | grep "Query time"

Test DNS Resolution

# Test DNS resolution
dig example.com +short

# Test reverse DNS lookup
dig -x 8.8.8.8 +short

# Test DNS server response
dig @8.8.8.8 example.com

# Check DNS record types
dig example.com A
dig example.com MX
dig example.com TXT

Method 2: Monitor DNS with nslookup

Check DNS Resolution Speed

# Basic DNS lookup
nslookup example.com

# Query specific DNS server
nslookup example.com 8.8.8.8

# Check DNS query time
time nslookup example.com

# Test multiple domains
for domain in example.com google.com github.com; do
  time nslookup $domain
done

Method 3: Automated DNS Monitoring with Zuzia.app

Checking by hand tells you the state right now. Zuzia checks from outside, around the clock, with nothing installed on the server.

How it works in Zuzia

  • Add a URL, a TCP port or a DNS record with the value you expect. The first check runs within about 30 seconds.
  • Websites can be checked as often as once a minute, from agents in Poland, New York and Singapore. Zuzia records the HTTP status code and response time of every check.
  • Zuzia warns you 14, 7 and 3 days before an SSL certificate expires, and does the same for the domain registration.
  • Alerts go by email, Slack, Discord, push (through your Pushover account) or SMS (through your Vonage account). A public status page or an embeddable widget shows your client the same uptime you see.

Setting it up

  1. In the Zuzia dashboard, add the URL, port or DNS record.
  2. Choose the check interval and your notification channels.
  3. Optionally create a status page or a widget for the client.

For the checks in this guide that run on the server itself, install the Zuzia agent and save those commands as a scheduled task.

Best Practices for DNS Performance Monitoring

1. Monitor DNS Query Times Continuously

  • Track DNS query response times regularly
  • Alert when query times exceed thresholds
  • Compare query times across DNS servers
  • Optimize DNS configuration based on data

2. Monitor DNS Resolution Success

  • Track DNS resolution success rate
  • Monitor DNS failure patterns
  • Alert on DNS resolution failures
  • Investigate root causes of failures

3. Test Multiple DNS Servers

  • Monitor performance of primary DNS servers
  • Test backup DNS servers
  • Compare DNS server performance
  • Switch DNS servers if needed

4. Monitor DNS Record Changes

  • Track DNS record modifications
  • Detect unauthorized DNS changes
  • Verify DNS record accuracy
  • Alert on DNS record changes

5. Set Up Automated Alerts

  • Configure alerts for slow DNS queries
  • Set up alerts for DNS failures
  • Monitor DNS server availability
  • Alert on DNS configuration changes

Troubleshooting DNS Performance Issues

Step 1: Identify DNS Problems

When DNS performance degrades:

  1. Check DNS Query Times:

    • Measure query times with dig
    • Compare with historical data
    • Identify slow queries
  2. Test DNS Resolution:

    • Test resolution for multiple domains
    • Check DNS server responses
    • Verify DNS configuration
  3. Review DNS Errors:

    • Check for DNS timeout errors
    • Review DNS server logs
    • Identify DNS failure patterns

Step 2: Optimize DNS Performance

Based on investigation:

  1. Optimize DNS Configuration:

    • Use faster DNS servers
    • Configure DNS caching
    • Optimize DNS records
  2. Fix DNS Issues:

    • Resolve DNS server problems
    • Fix DNS configuration errors
    • Update DNS records
  3. Scale DNS Infrastructure:

    • Add DNS servers if needed
    • Implement DNS load balancing
    • Optimize DNS server performance

FAQ: Common Questions About DNS Performance Monitoring

What is considered slow DNS query time?

Slow DNS query time depends on your requirements. Generally, query times under 50ms are excellent, 50-100ms are good, 100-200ms are acceptable, and over 200ms are slow. Set thresholds based on your application requirements.

How often should I check DNS performance?

For production servers, continuous automated monitoring is essential. Zuzia.app can check DNS performance every few minutes, storing historical data and alerting you when performance degrades.

Can DNS monitoring impact performance?

DNS monitoring commands have minimal impact on server performance. However, excessive monitoring frequency may impact network resources. Use appropriate monitoring intervals.

How do I identify which DNS server is fastest?

Test DNS query times from multiple DNS servers using dig or nslookup, compare response times, and use the fastest DNS server for your infrastructure. Zuzia.app can help automate this comparison.

Related guides, recipes, and problems

  • Related guides

    • guides--monitoring-domains.md
    • guides--network-health-monitoring-server-management.md
  • Related recipes

    • recipes--monitor-dns-query-response-times.md
    • recipes--how-to-check-dns-configuration-linux.md
    • recipes--monitor-dns-information-linux.md
  • Related problems

    • problems--dns-resolution-failures-timeout.md
    • problems--network-connectivity-issues-linux.md

We use cookies to ensure the proper functioning of our website.