0Pricing
Linux Networking & TCP/IP for Developers · Lektion

DNS-Konfiguration und Namensauflösung

Verstehen Sie, wie DNS unter Linux funktioniert, konfigurieren Sie DNS-Clients und beheben Sie Probleme bei der Namensauflösung.

DNS-Konfiguration und Namensauflösung ist eine kostenlose Linux Networking & TCP/IP for Developers-Lektion auf CoddyKit. Dies ist Lektion 3 von 4. Du kannst die komplette Lektion unten kostenlos lesen – dann übst du sie direkt im Browser mit einem integrierten Code-Editor und einem KI-Tutor rund um die Uhr. Sie ist Teil des Linux Networking & TCP/IP for Developers-Lernpfads, und dein Fortschritt wird über Web und CoddyKit-App synchronisiert. Der Linux Networking & TCP/IP for Developers-Kurs umfasst insgesamt 4 Lektionen.

Teile dieser Lektion wurden noch nicht übersetzt und werden auf Englisch angezeigt.

DNS: Name to Number

Welcome! Today we'll explore DNS (Domain Name System) in Linux. DNS is like the internet's phonebook, translating human-friendly domain names (like google.com) into machine-readable IP addresses (like 142.250.186.174).

Without DNS, you'd have to remember long numbers for every website or service you want to reach!

Your Linux DNS Client

In Linux, the primary configuration file for how your system resolves domain names is /etc/resolv.conf. This file tells your computer which DNS servers to ask when it needs to find an IP address for a hostname.

Think of it as your local DNS directory.

The `nameserver` Directive

The most important line in /etc/resolv.conf is nameserver. It specifies the IP address of a DNS server that your system should use.

  • You can list multiple nameserver entries.
  • Your system will try them in order until it gets a response.
  • Common public DNS servers are Google's (8.8.8.8, 8.8.4.4) or Cloudflare's (1.1.1.1).

View Your Current DNS

Let's see what DNS servers your system is currently configured to use. We can do this by displaying the contents of the /etc/resolv.conf file.

Try running the command below:

cat /etc/resolv.conf

Domain & Search Directives

Besides nameserver, you might also see domain and search directives in /etc/resolv.conf:

  • domain example.com: Sets the default domain name for the local host.
  • search example.com mycorp.local: Specifies a list of domains to try appending to hostnames that aren't fully qualified.

For example, if you ping webserver and search is mycorp.local, it will try webserver.mycorp.local.

Basic Lookups with `host`

The host command is a simple utility for performing DNS lookups. It's great for quickly finding the IP address of a domain or the domain name for an IP address.

It provides concise answers, making it perfect for quick checks.

`host` Command in Action

Let's use host to resolve a common domain. This command will query your configured DNS servers and return the associated IP address(es).

Run the example:

host coddykit.com

Detailed Queries with `dig`

For more detailed DNS information, the dig (Domain Information Groper) command is your go-to tool. It provides a comprehensive output of DNS records, including authoritative nameservers, record types (A, MX, NS, etc.), and more.

It's invaluable for troubleshooting.

`dig`ging for Records

Execute dig to see a full DNS query in action. Notice the different sections of the output, like the ANSWER SECTION, which contains the IP address, and AUTHORITY SECTION, which lists the authoritative nameservers for the domain.

Try it out:

dig coddykit.com

Basic DNS Troubleshooting

If you can't access a website by name but can by IP, it's likely a DNS issue. Here's a quick checklist:

  • Check /etc/resolv.conf: Are the nameserver IPs correct and reachable?
  • Test with ping 8.8.8.8: Can you reach an external DNS server by IP?
  • Use dig google.com @8.8.8.8: Explicitly query a working DNS server to see if resolution works that way.
  • Restart network service: Sometimes a network service restart can help apply changes.

DNS Client Configuration

You've learned about the key components of DNS client configuration in Linux.

Which of the following directives are commonly found in /etc/resolv.conf for configuring DNS client behavior?

Recap: DNS in Linux

Great job! You've learned how DNS works in Linux. You can now:

  • Identify /etc/resolv.conf as the primary DNS client configuration file.
  • Understand the role of nameserver, domain, and search directives.
  • Use host for quick DNS lookups.
  • Use dig for detailed DNS queries.
  • Perform basic troubleshooting for name resolution issues.

Mastering these tools is key to managing network services effectively!

Häufig gestellte Fragen

Ist die Lektion „DNS-Konfiguration und Namensauflösung“ kostenlos?

Ja — der vollständige Text von „DNS-Konfiguration und Namensauflösung“ ist hier im Web kostenlos zu lesen. Um sie interaktiv zu üben (integrierter Code-Editor und 24/7 KI-Tutor) und den Rest des Linux Networking & TCP/IP for Developers-Kurses freizuschalten, upgrade auf CoddyKit PRO. Der Linux Networking & TCP/IP for Developers-Kurs umfasst insgesamt 4 Lektionen.

Was lerne ich in „DNS-Konfiguration und Namensauflösung“?

Verstehen Sie, wie DNS unter Linux funktioniert, konfigurieren Sie DNS-Clients und beheben Sie Probleme bei der Namensauflösung. Du übst Linux Networking & TCP/IP for Developers mit praktischem Code, den du direkt im Browser ausführst, und ein 24/7 KI-Tutor beantwortet deine Fragen während du die Lektion bearbeitest.

Brauche ich Erfahrung, um Linux Networking & TCP/IP for Developers zu starten?

Keine Vorkenntnisse erforderlich. Linux Networking & TCP/IP for Developers auf CoddyKit ist für Anfänger bis fortgeschrittene Lernende strukturiert, sodass du hier starten oder von Anfang an beginnen und in deinem eigenen Tempo voranschreiten kannst. Dies ist Lektion 3 von 4.

Wie lange dauert die Lektion „DNS-Konfiguration und Namensauflösung“?

Die meisten CoddyKit-Lektionen dauern etwa 5–10 Minuten. Jede ist kompakt und interaktiv, sodass du stetig Fortschritte machst und genau dort weitermachst, wo du aufgehört hast – im Web und in der App.

Kann ich in dieser Linux Networking & TCP/IP for Developers-Lektion Code schreiben und ausführen?

Ja. Jede Linux Networking & TCP/IP for Developers-Lektion enthält einen integrierten Code-Editor, sodass du echten Code direkt in deinem Browser schreibst und ausführst und sofort KI-Feedback erhältst — ohne lokale Einrichtung erforderlich.

Alle Lektionen in diesem Kurs

  1. Netzwerkschnittstellen verwalten
  2. Routingtabellen und Gateways
  3. DNS-Konfiguration und Namensauflösung
  4. Die Linux-Firewall mit nftables konfigurieren
← Zurück zu Linux Networking & TCP/IP for Developers