Troubleshooting: DNS

dos2unix

Well-Known Member
Joined
May 3, 2019
Messages
3,525
Reaction score
3,287
Credits
31,524

DNS Troubleshooting Guide for Linux​

Identifying a DNS Issue​

If you can reach an IP address on the internet but not the DNS hostname, it's likely a DNS issue. This means your network connection is working, but the DNS resolution is failing.

Determining Your Current DNS Server​

To find out which DNS server you are currently using, you can use the resolvectl command:
Code:
 resolvectl status
This command will display the DNS servers configured for your network interfaces.

Querying Hosts and DNS Servers​

  1. Using nslookup
    • To query a host:
      Code:
       nslookup example.com
    • To query a host using a specific DNS server:
      Code:
       nslookup example.com 8.8.8.8
  2. Using dig
    • To query a host:
      Code:
       dig example.com
    • To query a host using a specific DNS server:
      Code:
       dig @8.8.8.8 example.com
  3. Using resolvectl
    • To query a host:
      Code:
       resolvectl query example.com
    • To query a host using a specific DNS server:
      Code:
       resolvectl query example.com 8.8.8.8

Internal Private DNS Server vs. Public DNS Server​

  • Internal Private DNS Server: This is a DNS server within a private network, typically used to resolve hostnames for devices within the same network. It is not accessible from the public internet.
  • Public DNS Server: This is a DNS server that is accessible from the public internet and can resolve hostnames for any domain. Examples include Google's DNS servers (8.8.8.8 and 8.8.4.4) and Cloudflare's DNS server (1.1.1.1).
Some public DNS servers allow you to use them for queries, providing an alternative if your default DNS server is not working correctly.

Popular Public DNS Servers​

  • Google DNS: 8.8.8.8, 8.8.4.4
  • Cloudflare DNS: 1.1.1.1, 1.0.0.1
  • OpenDNS: 208.67.222.222, 208.67.220.220
I hope this guide helps you troubleshoot DNS issues on your Linux system!
 


DNS stands for Domain Name System. It's a fundamental part of how the internet works. Here’s a simple explanation:

What is DNS?​

DNS is like the internet's phonebook. When you type a website address (like www.example.com) into your browser, DNS translates that human-readable address into an IP address (like 192.0.2.1) that computers use to identify each other on the network.

How Does DNS Work?​

  1. Query: When you enter a domain name in your browser, a DNS query is sent to a DNS server.
  2. Resolution: The DNS server looks up the domain name in its database and finds the corresponding IP address.
  3. Response: The DNS server sends the IP address back to your browser.
  4. Connection: Your browser uses the IP address to connect to the web server and load the website.

Why is DNS Important?​

  • User-Friendly: It allows us to use easy-to-remember domain names instead of numerical IP addresses.
  • Scalability: It helps manage the vast number of domain names and IP addresses on the internet.
  • Redundancy: Multiple DNS servers ensure that the system is reliable and can handle failures.
 


Members online


Top