dns-network
DNSルックアップや接続テスト、遅延診断を通じて、ネットワークのデバッグや接続タイムアウト、速度低下などの問題を解決するためのSkill。
📜 元の英語説明(参考)
Network debugging with DNS lookups, connectivity testing, and latency diagnosis. Use when user mentions "dns", "dig", "nslookup", "traceroute", "ping", "network debugging", "why is this slow", "connection timeout", "dns resolution", "curl timing", "network latency", "MTR", "netcat", or diagnosing network issues.
🇯🇵 日本人クリエイター向け解説
DNSルックアップや接続テスト、遅延診断を通じて、ネットワークのデバッグや接続タイムアウト、速度低下などの問題を解決するためのSkill。
※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。
下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o dns-network.zip https://jpskill.com/download/6080.zip && unzip -o dns-network.zip && rm dns-network.zip
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/6080.zip -OutFile "$d\dns-network.zip"; Expand-Archive "$d\dns-network.zip" -DestinationPath $d -Force; ri "$d\dns-network.zip"
完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。
💾 手動でダウンロードしたい(コマンドが難しい人向け)
- 1. 下の青いボタンを押して
dns-network.zipをダウンロード - 2. ZIPファイルをダブルクリックで解凍 →
dns-networkフォルダができる - 3. そのフォルダを
C:\Users\あなたの名前\.claude\skills\(Win)または~/.claude/skills/(Mac)へ移動 - 4. Claude Code を再起動
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-17
- 取得日時
- 2026-05-17
- 同梱ファイル
- 1
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
[スキル名] dns-network
DNSとネットワークのデバッグ
DNS、接続性、およびレイテンシーの問題を診断するための実践的なワークフローです。
DNSルックアップ
dig (推奨ツール)
# Aレコード (IPv4)
dig example.com
# 特定のレコードタイプ
dig example.com AAAA # IPv6
dig example.com MX # メールサーバー
dig example.com CNAME # Canonical name
dig example.com TXT # TXTレコード (SPF, DKIM, 検証)
dig example.com NS # ネームサーバー
dig example.com SOA # Start of authority
# 短い出力 (回答のみ)
dig +short example.com
dig +short example.com MX
# 特定のDNSサーバーにクエリを送信
dig @8.8.8.8 example.com
dig @1.1.1.1 example.com
# 完全な解決パスをトレース (ルート -> TLD -> 権威サーバー)
dig +trace example.com
# 逆引きルックアップ (IPからホスト名へ)
dig -x 93.184.216.34
# 取得できるすべてのレコードを表示
dig example.com ANY +noall +answer
# ファイルからのバッチルックアップ (1行に1ドメイン)
dig -f domains.txt +short
nslookup
nslookup example.com
nslookup example.com 8.8.8.8 # 特定のサーバーを使用
nslookup -type=MX example.com # MXレコード
nslookup -type=TXT example.com # TXTレコード
host (素早くシンプル)
host example.com
host -t MX example.com
host 93.184.216.34 # 逆引きルックアップ
DNS伝播の確認
DNSレコードを変更した際、複数のリゾルバーで変更が伝播しているかを確認します。
for dns in 8.8.8.8 1.1.1.1 208.67.222.222 9.9.9.9; do
echo "--- $dns ---"
dig @$dns example.com +short
done
権威ネームサーバーに直接クエリを送信して、ソースでレコードが正しいことを確認します。
# 権威NSを検索
dig +short example.com NS
# 直接クエリを送信
dig @ns1.example.com example.com +short
接続性テスト
ping
ping example.com # 継続 (Ctrl+Cで停止)
ping -c 5 example.com # 5つのパケットを送信
ping -c 5 -i 0.2 example.com # パケット間の間隔を200msに設定
ping -W 2 example.com # パケットごとに2秒のタイムアウト (Linux)
ping -t 2 example.com # パケットごとに2秒のタイムアウト (macOS)
確認すべき点: パケット損失率とラウンドトリップ時間の変動です。一貫した高レイテンシーは、断続的なパケット損失とは異なり、それぞれ異なる問題を示唆しています。
traceroute / tracepath
traceroute example.com # 宛先までの各ホップを表示
traceroute -n example.com # 逆引きDNSをスキップ (高速化)
traceroute -T -p 443 example.com # ポート443でTCP traceroute
traceroute -I example.com # UDPの代わりにICMPを使用
出力をホップごとに読み取ります。特定のホップでレイテンシーが急激に上昇した場合、それが遅延の原因箇所です。アスタリスク (* * *) は、そのホップがプローブをフィルタリングしていることを意味し、必ずしも問題ではありません。
mtr (ping + tracerouteを組み合わせたもの)
mtr example.com # インタラクティブでリアルタイム更新
mtr -r -c 100 example.com # レポートモード、100サイクル
mtr -rw -c 50 example.com # ワイドレポート (完全なホスト名)
mtr -T -P 443 example.com # ポート443でTCPモード
mtrは、パスレベルの問題を診断するための最適な単一ツールです。各ホップのLoss%とAvg列は、パケットがどこでドロップまたは遅延しているかを正確に示します。
curlのタイミング内訳
これは、「サイトが遅い」という苦情を診断するための頼りになるツールです。
curl -o /dev/null -s -w "\
DNS lookup: %{time_namelookup}s\n\
TCP connect: %{time_connect}s\n\
TLS handshake: %{time_appconnect}s\n\
First byte: %{time_starttransfer}s\n\
Total time: %{time_total}s\n\
HTTP code: %{http_code}\n" \
https://example.com
出力の読み方:
- time_namelookup が高い (>100ms): DNSが遅いです。リゾルバーを確認し、8.8.8.8を試してください。
- time_connect - time_namelookup が高い: サーバーへのネットワークパスが遅いです。
- time_appconnect - time_connect が高い: TLSネゴシエーションが遅いです (証明書チェーンの問題、サーバーが遅い)。
- time_starttransfer - time_appconnect が高い: サーバーが応答を生成するのが遅いです (バックエンドの問題)。
- time_total - time_starttransfer が高い: 応答ボディが大きいか、転送速度が遅いです。
HTTPデバッグのためのcurl詳細モード
# 完全なリクエスト/レスポンスヘッダーとTLSの詳細
curl -v https://example.com
# さらに詳細 (トラフィックの16進ダンプ)
curl --trace - https://example.com
# レスポンスヘッダーのみを表示
curl -I https://example.com
# リダイレクトを追跡し、各ホップを表示
curl -vL https://example.com 2>&1 | grep -E '< HTTP|< Location'
ポートテスト
netcat (nc)
# ポートが開いているか確認
nc -zv example.com 443
nc -zv example.com 80
# ポート範囲をスキャン
nc -zv example.com 20-25
# タイムアウト付き
nc -zv -w 3 example.com 443
# UDPポートをテスト
nc -zuv example.com 53
ローカルマシンでリッスンしているポートの確認
# ss (netstatの現代的な代替)
ss -tlnp # プロセス名付きのTCPリッスンポート
ss -ulnp # UDPリッスンポート
ss -tlnp | grep :8080 # 特定のポートを確認
ss -s # 概要統計
# netstat (古いですが汎用)
netstat -tlnp # TCPリッスン (Linux)
netstat -an | grep LISTEN # すべてのリッスン (macOS)
# lsof
lsof -i :8080 # ポート8080を使用しているプロセス
lsof -i -P -n | grep LISTEN # すべてのリッスンポート
tcpdumpの基本
# インターフェース上のすべてのトラフィックをキャプチャ
sudo tcpdump -i eth0
# ホストでフィルタリング
sudo tcpdump -i eth0 host example.com
# ポートでフィルタリング
sudo tcpdump -i eth0 port 443
sudo tcpdump -i eth0 port 53 # DNSトラフィック
# プロトコルでフィルタリング
sudo tcpdump -i eth0 tcp
sudo tcpdump -i eth0 udp and port 53
# Wireshark分析用にファイルに保存
sudo tcpdump -i eth0 -w capture.pcap port 443
# キャプチャファイルを読み込む
sudo tcpdump -r capture.pcap
# パケットの内容をASCIIで表示
sudo tcpdump -A -i eth0 port 80
# キャプチャをN個のパケットに制限
sudo tcpdump -c 100 -i eth0 port 443
# 一般的な組み合わせ: 発信されるDNSクエリ 📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
DNS & Network Debugging
Practical workflows for diagnosing DNS, connectivity, and latency problems.
DNS Lookups
dig (preferred tool)
# A record (IPv4)
dig example.com
# Specific record types
dig example.com AAAA # IPv6
dig example.com MX # Mail servers
dig example.com CNAME # Canonical name
dig example.com TXT # TXT records (SPF, DKIM, verification)
dig example.com NS # Nameservers
dig example.com SOA # Start of authority
# Short output (just the answer)
dig +short example.com
dig +short example.com MX
# Query a specific DNS server
dig @8.8.8.8 example.com
dig @1.1.1.1 example.com
# Trace the full resolution path (root -> TLD -> authoritative)
dig +trace example.com
# Reverse lookup (IP to hostname)
dig -x 93.184.216.34
# Show all records you can get
dig example.com ANY +noall +answer
# Batch lookup from file (one domain per line)
dig -f domains.txt +short
nslookup
nslookup example.com
nslookup example.com 8.8.8.8 # Use specific server
nslookup -type=MX example.com # MX records
nslookup -type=TXT example.com # TXT records
host (quick and simple)
host example.com
host -t MX example.com
host 93.184.216.34 # Reverse lookup
Checking DNS Propagation
When you change DNS records, check multiple resolvers to see if the change has spread:
for dns in 8.8.8.8 1.1.1.1 208.67.222.222 9.9.9.9; do
echo "--- $dns ---"
dig @$dns example.com +short
done
Check the authoritative nameserver directly to confirm the record is correct at the source:
# Find authoritative NS
dig +short example.com NS
# Query it directly
dig @ns1.example.com example.com +short
Connectivity Testing
ping
ping example.com # Continuous (Ctrl+C to stop)
ping -c 5 example.com # Send 5 packets
ping -c 5 -i 0.2 example.com # 200ms interval between packets
ping -W 2 example.com # 2-second timeout per packet (Linux)
ping -t 2 example.com # 2-second timeout per packet (macOS)
What to look for: packet loss percentage and round-trip time variation. Consistent high latency is different from intermittent packet loss -- they point to different problems.
traceroute / tracepath
traceroute example.com # Show each hop to destination
traceroute -n example.com # Skip reverse DNS (faster)
traceroute -T -p 443 example.com # TCP traceroute on port 443
traceroute -I example.com # Use ICMP instead of UDP
Read the output hop by hop. A sudden jump in latency at a specific hop identifies where the slowdown is. Stars (* * *) mean that hop is filtering probes -- not necessarily a problem.
mtr (combines ping + traceroute)
mtr example.com # Interactive, live-updating
mtr -r -c 100 example.com # Report mode, 100 cycles
mtr -rw -c 50 example.com # Wide report (full hostnames)
mtr -T -P 443 example.com # TCP mode on port 443
mtr is the best single tool for diagnosing path-level problems. The Loss% and Avg columns per hop tell you exactly where packets are being dropped or delayed.
curl Timing Breakdown
This is the go-to for diagnosing "the site is slow" complaints:
curl -o /dev/null -s -w "\
DNS lookup: %{time_namelookup}s\n\
TCP connect: %{time_connect}s\n\
TLS handshake: %{time_appconnect}s\n\
First byte: %{time_starttransfer}s\n\
Total time: %{time_total}s\n\
HTTP code: %{http_code}\n" \
https://example.com
How to read the output:
- time_namelookup high (>100ms): DNS is slow. Check resolver, try 8.8.8.8.
- time_connect - time_namelookup high: Network path to server is slow.
- time_appconnect - time_connect high: TLS negotiation is slow (cert chain issues, slow server).
- time_starttransfer - time_appconnect high: Server is slow to generate the response (backend problem).
- time_total - time_starttransfer high: Large response body or slow transfer rate.
curl verbose mode for HTTP debugging
# Full request/response headers and TLS details
curl -v https://example.com
# Even more detail (hex dump of traffic)
curl --trace - https://example.com
# Show only response headers
curl -I https://example.com
# Follow redirects and show each hop
curl -vL https://example.com 2>&1 | grep -E '< HTTP|< Location'
Port Testing
netcat (nc)
# Check if a port is open
nc -zv example.com 443
nc -zv example.com 80
# Scan a range of ports
nc -zv example.com 20-25
# With timeout
nc -zv -w 3 example.com 443
# Test UDP port
nc -zuv example.com 53
Checking listening ports on local machine
# ss (modern replacement for netstat)
ss -tlnp # TCP listening ports with process names
ss -ulnp # UDP listening ports
ss -tlnp | grep :8080 # Check specific port
ss -s # Summary statistics
# netstat (older but universal)
netstat -tlnp # TCP listening (Linux)
netstat -an | grep LISTEN # All listening (macOS)
# lsof
lsof -i :8080 # What process is on port 8080
lsof -i -P -n | grep LISTEN # All listening ports
tcpdump Basics
# Capture all traffic on an interface
sudo tcpdump -i eth0
# Filter by host
sudo tcpdump -i eth0 host example.com
# Filter by port
sudo tcpdump -i eth0 port 443
sudo tcpdump -i eth0 port 53 # DNS traffic
# Filter by protocol
sudo tcpdump -i eth0 tcp
sudo tcpdump -i eth0 udp and port 53
# Save to file for Wireshark analysis
sudo tcpdump -i eth0 -w capture.pcap port 443
# Read a capture file
sudo tcpdump -r capture.pcap
# Show packet contents in ASCII
sudo tcpdump -A -i eth0 port 80
# Limit capture to N packets
sudo tcpdump -c 100 -i eth0 port 443
# Common combo: DNS queries leaving this machine
sudo tcpdump -i any -n port 53
On macOS, use en0 (Wi-Fi) or en1 instead of eth0. Run tcpdump -D to list available interfaces.
Local Configuration Files
/etc/hosts
Static hostname-to-IP mappings. Checked before DNS.
# View current entries
cat /etc/hosts
# Add a temporary override (useful for testing before DNS changes)
echo "93.184.216.34 example.com" | sudo tee -a /etc/hosts
# Remove it when done
sudo sed -i '/example.com/d' /etc/hosts # Linux
sudo sed -i '' '/example.com/d' /etc/hosts # macOS
/etc/resolv.conf
DNS resolver configuration.
cat /etc/resolv.conf
# Typical contents:
# nameserver 8.8.8.8
# nameserver 8.8.4.4
# search mycompany.internal
On systems using systemd-resolved, the actual config may be managed elsewhere. Check with resolvectl status.
On macOS, DNS is managed by the system. Check with scutil --dns.
Diagnostic Workflows
"The site is slow"
- Run the curl timing breakdown to isolate which phase is slow.
- If DNS is slow: check
dig +shorttime, try alternate resolvers. - If connect is slow: run
mtr -r -c 50to find where latency spikes. - If TLS is slow: check
curl -vfor cert chain issues or protocol negotiation problems. - If first-byte is slow: the problem is server-side. Check application logs and server resources.
- If transfer is slow: check response size, consider compression, test bandwidth.
"I can't connect to the service"
- Can you resolve the hostname?
dig +short hostname - Can you reach the IP?
ping -c 3 <ip> - Is the port open?
nc -zv hostname port - Is something listening locally?
ss -tlnp | grep :port - Is a firewall blocking?
sudo iptables -L -n(Linux) or check security groups if cloud-hosted. - Is the route correct?
traceroute -n hostname
"DNS isn't resolving"
- Check what resolver you are using:
cat /etc/resolv.conforscutil --dns(macOS). - Query the resolver directly:
dig @<resolver-ip> hostname - Query a known-good public resolver:
dig @8.8.8.8 hostname - If public works but local does not: local resolver or network is the problem.
- If neither works: check if the domain actually has records:
dig +trace hostname - Check for /etc/hosts overrides that might be interfering.
"Works from my machine but not from the server"
- Compare DNS results from both machines:
dig +short hostname - Compare routes:
mtr -r -c 20 hostnamefrom both. - Check if the server has outbound firewall rules or proxy settings.
- Check if the server uses a different resolver (corporate DNS, VPN split-tunnel).
- Check environment variables:
env | grep -i proxy
Quick Reference
| Task | Command |
|---|---|
| Resolve hostname | dig +short example.com |
| Reverse lookup | dig -x 1.2.3.4 |
| Check MX records | dig +short example.com MX |
| Trace DNS path | dig +trace example.com |
| Test port open | nc -zv host 443 |
| Find what is on a port | lsof -i :8080 |
| Listening ports | ss -tlnp |
| Path analysis | mtr -r -c 50 host |
| Capture DNS traffic | sudo tcpdump -i any -n port 53 |
| Full curl timing | curl -o /dev/null -s -w "dns:%{time_namelookup} connect:%{time_connect} tls:%{time_appconnect} firstbyte:%{time_starttransfer} total:%{time_total}\n" URL |