ネットワーク診断:`traceroute`、`nslookup`、`dig`
専用のコマンドラインツールを使って、高度なネットワークトラブルシューティングとDNS lookupを行います。
「ネットワーク診断:`traceroute`、`nslookup`、`dig`」はCoddyKit上の無料Linux Command Line Masteryレッスンです。 これはレッスン1/4です。 下記で完全なレッスンを無料で読むことができます。その後、ブラウザ内の組み込みコードエディタと24時間対応のAIチューターでハンズオン演習できます。 これは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.comDeciphering 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.comDeeper `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.comUnderstanding `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:
traceroutemaps the path to a host, showing latency at each hop.nslookupqueries DNS for basic domain-to-IP resolution.digprovides more detailed and flexible DNS query options.
These commands are essential for understanding and troubleshooting network issues!
よくある質問
「ネットワーク診断:`traceroute`、`nslookup`、`dig`」レッスンは無料ですか?
はい。「ネットワーク診断:`traceroute`、`nslookup`、`dig`」の完全なテキストはこのウェブで無料で読めます。インタラクティブに演習し(組み込みコードエディタと24時間対応のAIチューター)、Linux Command Line Masteryコースの残りをアンロックするには、CoddyKit PROにアップグレードしてください。 Linux Command Line Masteryコースには全4レッスンが含まれています。
「ネットワーク診断:`traceroute`、`nslookup`、`dig`」で何を学びますか?
専用のコマンドラインツールを使って、高度なネットワークトラブルシューティングとDNS lookupを行います。 ブラウザで直接実行するハンズオンコードでLinux Command Line Masteryを演習し、24時間対応のAIチューターがレッスンを進める中での質問に答えます。
Linux Command Line Masteryを始めるのに経験は必要ですか?
事前経験は必要ありません。CoddyKitのLinux Command Line Masteryは初級者から上級者向けに構成されているため、ここから始めるか最初から始めて、自分のペースで進むことができます。 これはレッスン1/4です。
「ネットワーク診断:`traceroute`、`nslookup`、`dig`」レッスンにはどのくらい時間がかかりますか?
ほとんどのCoddyKitレッスンは約5~10分かかります。各レッスンはコンパクトでインタラクティブなので、着実に進歩し、ウェブとアプリ全体で正確に前回の場所から再開できます。
このLinux Command Line Masteryレッスンでコードを書いて実行できますか?
はい。すべてのLinux Command Line Masteryレッスンに組み込みコードエディタが含まれているため、ブラウザでリアルコードを書いて実行し、即座のAIフィードバックを取得できます。ローカル設定は不要です。
このコースのすべてのレッスン
- ネットワーク診断:`traceroute`、`nslookup`、`dig`
- ファイアウォール管理:`ufw`、`firewalld`、`iptables`
- Secure Shellキーの管理
- tcpdump でトラフィックを取得・調査する