0Pricing
Linux Command Line Mastery · Lekcja

Diagnostyka sieci: `traceroute`, `nslookup`, `dig`

Nauczą się Państwo zaawansowanego rozwiązywania problemów z siecią i wykonywania zapytań DNS za pomocą specjalistycznych narzędzi wiersza poleceń.

Diagnostyka sieci: `traceroute`, `nslookup`, `dig` to bezpłatna lekcja Linux Command Line Mastery na CoddyKit. To lekcja 1 z 4. Możesz przeczytać całą lekcję poniżej za darmo — a potem ćwiczyć ją interaktywnie w przeglądarce z wbudowanym edytorem kodu i tutorem AI dostępnym 24/7. To część ścieżki edukacyjnej Linux Command Line Mastery, a Twój postęp synchronizuje się między webem a aplikacją CoddyKit. Kurs Linux Command Line Mastery zawiera 4 lekcji w sumie.

Części tej lekcji nie zostały jeszcze przetłumaczone i są wyświetlane po angielsku.

Welcome to Network Diagnostics

Ever wonder why a website is slow or unreachable? Network diagnostics help you pinpoint issues!

In this lesson, we'll explore powerful command-line tools like traceroute, nslookup, and dig.

These tools help you understand network paths and resolve domain names.

Beyond Basic Connectivity

You might already know ping for checking if a host is reachable. But what if it's reachable but slow?

traceroute (or tracert on Windows) goes a step further. It maps the path your data takes to reach a destination.

Mapping the Network Path

traceroute sends small packets and measures the time it takes for each "hop" (router) along the way to respond.

  • Each line in the output represents a router.
  • It shows the IP address and latency (how long it took to respond).
  • This helps identify where delays or failures occur.

Your First Traceroute

To use traceroute, simply provide a hostname or IP address. Let's trace the path to example.com.

Note: You might need to install traceroute on some Linux systems (e.g., sudo apt install traceroute).

traceroute example.com

Deciphering Traceroute Results

The output shows numbered hops, each with a router's IP address and three latency measurements (in milliseconds).

  • Hop Number: The sequence in the path.
  • Latency: Time for the packet to reach that hop and return.
  • Asterisks (*): A hop that didn't respond, possibly due to a firewall.

High latency at a specific hop can indicate a bottleneck.

DNS: The Internet's Phonebook

When you type "google.com" into your browser, how does your computer know where to find it?

It uses the Domain Name System (DNS)! DNS translates human-readable domain names (like "google.com") into machine-readable IP addresses (like "142.250.190.14").

Basic `nslookup` Queries

nslookup is a simple tool to query DNS servers for information about domain names.

It's often used to find the IP address associated with a hostname, or vice-versa.

nslookup example.com

Deeper `nslookup` Queries

Beyond simple IP lookups, nslookup can query for different types of DNS records:

  • MX (Mail Exchanger): Mail server addresses.
  • NS (Name Server): Authoritative DNS servers for a domain.
  • TXT (Text): General text information, often used for verification.

Use set type=MX (or NS, TXT) before your query.

nslookup
set type=MX
google.com
exit

`dig`: The Advanced DNS Tool

While nslookup is easy, dig (Domain Information Groper) offers more detailed and flexible DNS querying capabilities.

It's preferred by network administrators for its comprehensive output and ability to query specific DNS servers.

dig example.com

Understanding `dig`'s Output

dig provides a more verbose output than nslookup, including:

  • Question Section: What you asked for.
  • Answer Section: The DNS records found.
  • Authority Section: Name servers for the domain.
  • Additional Section: Extra helpful records.

This detail is invaluable for troubleshooting.

Quick Check: Network Tools

You're troubleshooting a website that's slow to load. You suspect a bottleneck somewhere between your machine and the server.

Which command would you use to trace the path and identify potential points of delay?

Recap: Network Diagnostics

Great job! You've learned to use powerful tools for network diagnostics:

  • traceroute maps the path to a host, showing latency at each hop.
  • nslookup queries DNS for basic domain-to-IP resolution.
  • dig provides more detailed and flexible DNS query options.

These commands are essential for understanding and troubleshooting network issues!

Często zadawane pytania

Czy lekcja „Diagnostyka sieci: `traceroute`, `nslookup`, `dig`” jest bezpłatna?

Tak — pełny tekst „Diagnostyka sieci: `traceroute`, `nslookup`, `dig`” jest dostępny za darmo tutaj w sieci. Aby ćwiczyć ją interaktywnie (wbudowany edytor kodu i tutor AI dostępny 24/7) i odblokować resztę kursu Linux Command Line Mastery, przejdź na CoddyKit PRO. Kurs Linux Command Line Mastery zawiera 4 lekcji w sumie.

Co nauczysz się w „Diagnostyka sieci: `traceroute`, `nslookup`, `dig`”?

Nauczą się Państwo zaawansowanego rozwiązywania problemów z siecią i wykonywania zapytań DNS za pomocą specjalistycznych narzędzi wiersza poleceń. Ćwiczysz Linux Command Line Mastery z praktycznym kodem, który uruchamiasz bezpośrednio w przeglądarce, a tutor AI dostępny 24/7 odpowiada na Twoje pytania podczas pracy nad lekcją.

Czy potrzebuję doświadczenia, aby zacząć Linux Command Line Mastery?

Nie wymagamy żadnego doświadczenia. Linux Command Line Mastery w CoddyKit jest strukturyzowany dla początkujących i zaawansowanych użytkowników, więc możesz zacząć tutaj lub od początku i uczyć się w swoim tempie. To lekcja 1 z 4.

Ile czasu zajmuje lekcja „Diagnostyka sieci: `traceroute`, `nslookup`, `dig`”?

Większość lekcji CoddyKit trwa około 5–10 minut. Każda lekcja to mały, interaktywny krok, dzięki czemu robisz systematyczne postępy i zawsze wracasz dokładnie do tego samego miejsca — na webie i w aplikacji.

Czy mogę pisać i uruchamiać kod w tej lekcji Linux Command Line Mastery?

Tak. Każda lekcja Linux Command Line Mastery zawiera wbudowany edytor kodu, więc piszesz i uruchamiasz prawdziwy kod bezpośrednio w przeglądarce i od razu otrzymujesz sprzężenie zwrotne od AI — bez konfiguracji na komputerze.

Wszystkie lekcje w tym kursie

  1. Diagnostyka sieci: `traceroute`, `nslookup`, `dig`
  2. Zarządzanie zaporą sieciową: `ufw`, `firewalld`, `iptables`
  3. Zarządzanie kluczami Secure Shell
  4. Przechwytywanie i analiza ruchu za pomocą tcpdump
← Powrót do Linux Command Line Mastery