0Pricing
Linux Command Line Mastery · บทเรียน

การวินิจฉัยเครือข่าย: `traceroute`, `nslookup`, `dig`

แก้ไขปัญหาเครือข่ายขั้นสูงและค้นหา DNS ด้วยเครื่องมือบรรทัดคำสั่งเฉพาะทาง

การวินิจฉัยเครือข่าย: `traceroute`, `nslookup`, `dig` เป็นบทเรียน Linux Command Line Mastery ฟรีบน CoddyKit นี่คือบทเรียนที่ 1 จากทั้งหมด 4 บทเรียน คุณสามารถอ่านบทเรียนทั้งหมดด้านล่างฟรี — จากนั้นลองปฏิบัติด้วยตัวคุณเองในเบราว์เซอร์พร้อมตัวแก้ไขโค้ดในตัวและติวเตอร์ AI ตลอด 24/7 บทเรียนนี้เป็นส่วนหนึ่งของเส้นทางการเรียน Linux Command Line Mastery และความก้าวหน้าของคุณจะซิงค์ข้ามเว็บและแอป CoddyKit คอร์ส Linux Command Line Mastery มีบทเรียนทั้งหมด 4 บทเรียน

บางส่วนของบทเรียนนี้ยังไม่ได้รับการแปล และแสดงเป็นภาษาอังกฤษ

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!

คำถามที่พบบ่อย

บทเรียน “การวินิจฉัยเครือข่าย: `traceroute`, `nslookup`, `dig`” ฟรีหรือไม่

ใช่ — ข้อความเต็มของ “การวินิจฉัยเครือข่าย: `traceroute`, `nslookup`, `dig`” ฟรีให้อ่านที่นี่บนเว็บ เพื่อปฏิบัติแบบโต้ตอบ (ตัวแก้ไขโค้ดในตัวและติวเตอร์ AI ตลอด 24/7) และปลดล็อคส่วนที่เหลือของคอร์ส Linux Command Line Mastery ให้อัปเกรดเป็น CoddyKit PRO คอร์ส Linux Command Line Mastery มีบทเรียนทั้งหมด 4 บทเรียน

คุณจะเรียนรู้อะไรในบทเรียน “การวินิจฉัยเครือข่าย: `traceroute`, `nslookup`, `dig`”

แก้ไขปัญหาเครือข่ายขั้นสูงและค้นหา DNS ด้วยเครื่องมือบรรทัดคำสั่งเฉพาะทาง คุณปฏิบัติ Linux Command Line Mastery ด้วยโค้ดที่ใช้งานได้จริงที่คุณเรียกใช้โดยตรงในเบราว์เซอร์ และติวเตอร์ AI ตลอด 24/7 ตอบคำถามของคุณขณะที่คุณไปผ่านบทเรียน

คุณต้องมีประสบการณ์ก่อนที่จะเริ่มเรียน Linux Command Line Mastery หรือไม่

ไม่จำเป็นต้องมีประสบการณ์มาก่อน Linux Command Line Mastery บน CoddyKit ออกแบบมาสำหรับผู้เริ่มต้นไปจนถึงผู้เรียนขั้นสูง คุณสามารถเริ่มต้นที่นี่หรือเริ่มจากตัวแรกและเรียนด้วยความเร็วของคุณเอง นี่คือบทเรียนที่ 1 จากทั้งหมด 4 บทเรียน

บทเรียน “การวินิจฉัยเครือข่าย: `traceroute`, `nslookup`, `dig`” ใช้เวลานานแค่ไหน

บทเรียน CoddyKit ส่วนใหญ่ใช้เวลาประมาณ 5–10 นาที แต่ละบทเรียนจึงสั้นและเป็นแบบโต้ตอบ คุณสามารถก้าวหน้าอย่างต่อเนื่องและกลับมาเรียนต่อจากตรงที่เพิ่งหยุดบนเว็บและแอปได้เลย

ฉันเขียนและรันโค้ดในบทเรียน Linux Command Line Mastery นี้ได้ไหม

ได้ บทเรียน Linux Command Line Mastery ทุกบทมีตัวแก้ไขโค้ดในตัว คุณจึงเขียนและรันโค้ดจริงได้เลยในเบราว์เซอร์ และได้รับข้อเสนอแนะจาก AI ในทันที — ไม่ต้องติดตั้งในเครื่องของคุณ

บทเรียนทั้งหมดในหลักสูตรนี้

  1. การวินิจฉัยเครือข่าย: `traceroute`, `nslookup`, `dig`
  2. การจัดการไฟร์วอลล์: `ufw`, `firewalld`, `iptables`
  3. การจัดการคีย์ Secure Shell
  4. การจับและตรวจสอบปริมาณการรับส่งข้อมูลด้วย tcpdump
← กลับไปที่ Linux Command Line Mastery