Practice Exercise: DNS Troubleshooting with Linux dig
Introduction
In this lab, you will step into the role of a system administrator and learn how to use the dig
command on a CentOS 8 client to troubleshoot DNS issues. DNS (Domain Name System) is a fundamental part of networking, translating human-readable domain names into IP addresses. Understanding how to use dig
effectively is crucial for diagnosing DNS problems.
Prerequisites
- Basic knowledge of Linux command line
- A CentOS 8 virtual machine (client)
- Internet connectivity on the client
Lab Scenario
You are responsible for troubleshooting DNS-related issues on a CentOS 8 client. Your goal is to use the dig
command to gather DNS information, resolve domain names, and diagnose any problems that may arise while interacting with various freely available sites on the internet.
Tasks
Task 1: Testing DNS Resolution
- Use the
dig
command to check connectivity to a well-known server (e.g., google.com). dig google.com
Task 2: Querying Specific DNS Records
- Use
dig
to query and display specific DNS record types for a domain (e.g., MX, NS, TXT, etc.). dig example.com MX
Task 3: DNSSEC Validation
- Enable DNSSEC validation in your
dig
queries using the+dnssec
flag. dig +dnssec dnssec-failed.org
Task 4: Debugging DNS Configuration
- Simulate DNS issues by querying a non-existent domain using
dig
. dig non-existent-domain.com
Task 5: Verbose Output
- Use
dig
with the+short
flag to display only essential information. dig +short google.com
Task 6: Reverse DNS Lookup
- Perform a reverse DNS lookup using
dig
by querying an IP address for a domain name. dig -x 8.8.8.8
- Verify the returned PTR (pointer) record.
Task 7: Checking DNS Cache
- Query a domain using
dig
and note the response time. - Repeat the query and observe if the response time improves due to caching.
Task 8: Troubleshooting DNS Servers
- Change your DNS server settings to use a public DNS server (e.g., 8.8.8.8).
echo "nameserver 8.8.8.8" > /etc/resolv.conf
Task 9: DNS Load Balancing
- Query the DNS records of a well-known load-balanced domain (e.g., www.google.com).
- Observe multiple IP addresses returned, indicating load balancing.
Task 10: Querying IPv6 Records
- Use
dig
to query AAAA (IPv6) records for a domain that supports IPv6. - Understand how IPv6 records are structured and used.
Sample Troubleshooting Command
- Simulate DNS server unavailability by querying a DNS server with no response.
dig @unresponsive-dns-server.com example.com
These exercises will help you become proficient in using the dig
command to troubleshoot DNS issues on your CentOS 8 client.