Linux Networking & TCP/IP for Developers · Pelajaran

Diagnostik DNS dengan dig dan nslookup

Diagnosis masalah resolusi nama di Linux menggunakan dig, nslookup, dan host untuk memeriksa catatan DNS, melacak jalur resolusi, dan menemukan kesalahan konfigurasi.

Pelajaran 4 dari 413 langkah

Diagnostik DNS dengan dig dan nslookup adalah pelajaran Linux Networking & TCP/IP for Developers gratis di CoddyKit. Ini adalah pelajaran 4 dari 4. Kamu bisa membaca pelajaran lengkapnya di bawah secara gratis — lalu praktikkan langsung di browser dengan editor kode bawaan dan tutor AI 24/7. Ini adalah bagian dari jalur belajar Linux Networking & TCP/IP for Developers, dan progresmu tersinkronisasi di web dan aplikasi CoddyKit. Kursus Linux Networking & TCP/IP for Developers mencakup 4 pelajaran total.

Bagian dari pelajaran ini belum diterjemahkan dan ditampilkan dalam bahasa Inggris.

Why DNS Diagnostics Matter

Many 'network is down' reports are really DNS failures. The host is reachable by IP, but the name will not resolve.

Linux ships tools to inspect resolution directly:

  • dig — flexible, scriptable lookups
  • nslookup — classic interactive tool
  • host — quick one-line answers

This lesson focuses on reading their output to find the real problem.

A Basic dig Query

Run dig followed by a hostname to fetch its A record.

The key part of the output is the ANSWER SECTION, which lists the resolved addresses and their TTL.

dig example.com

Reading the dig Answer Section

Each answer line shows: name TTL class type value.

  • TTL — seconds the record may be cached
  • type — A, AAAA, MX, CNAME, etc.
  • value — the resolved data

Use +short to strip everything except the value.

dig +short example.com

Querying Specific Record Types

Append the record type to look up anything besides an A record.

  • dig example.com MX — mail servers
  • dig example.com AAAA — IPv6
  • dig example.com TXT — text records (SPF, verification)
dig example.com MX

Choosing a Specific Resolver

Use @server to bypass your local resolver and ask a specific DNS server. This isolates whether your local cache is the problem.

Below queries Google Public DNS directly.

dig @8.8.8.8 example.com

Tracing the Resolution Path

dig +trace walks from the root servers down to the authoritative server, printing each delegation step.

This reveals broken delegations or stale glue records that a normal query hides.

dig +trace example.com

Reverse DNS Lookups

To map an IP back to a name, use -x. This queries the PTR record.

Missing PTR records often cause mail delivery and logging issues.

dig -x 8.8.8.8

Using nslookup Interactively

nslookup can run one-shot or interactively. In interactive mode you set type= and switch servers with server.

nslookup -type=MX example.com

Quick Answers with host

host gives compact output, ideal for quick checks.

  • host example.com — A and AAAA
  • host -t NS example.com — nameservers
host -t NS example.com

Interpreting Status Codes

The status field in the dig header is critical:

  • NOERROR — resolved fine
  • NXDOMAIN — name does not exist
  • SERVFAIL — server failed (often DNSSEC or upstream issues)

Checking the Local Resolver Config

Linux resolution settings live in /etc/resolv.conf and /etc/nsswitch.conf.

If dig works but applications fail, suspect nsswitch.conf ordering or a stale resolv.conf.

cat /etc/resolv.conf

Quick Check

Test your understanding of dig output.

Recap

You now diagnose DNS issues directly:

  • dig for flexible, scriptable lookups and +trace
  • @server to isolate resolver problems
  • -x for reverse lookups
  • Read status codes (NOERROR/NXDOMAIN/SERVFAIL)
  • Check /etc/resolv.conf and nsswitch.conf for local issues

These skills complement packet capture and firewall analysis for end-to-end troubleshooting.

Gratis untuk memulai

Belajar Linux Networking & TCP/IP for Developers dengan tutor AI — gratis

Tulis dan jalankan kode asli di browser kamu, dapatkan bantuan instan dari tutor AI 24/7, dan lanjutkan di mana kamu tinggalkan di web atau aplikasi.

Kursus
12
Pelajaran
48

Pertanyaan yang Sering Diajukan

Apakah pelajaran “Diagnostik DNS dengan dig dan nslookup” gratis?

Ya — teks lengkap “Diagnostik DNS dengan dig dan nslookup” gratis dibaca di sini di web. Untuk praktiknya secara interaktif (editor kode bawaan dan tutor AI 24/7) dan buka sisa kursus Linux Networking & TCP/IP for Developers, upgrade ke CoddyKit PRO. Kursus Linux Networking & TCP/IP for Developers mencakup 4 pelajaran total.

Apa yang akan aku pelajari di “Diagnostik DNS dengan dig dan nslookup”?

Diagnosis masalah resolusi nama di Linux menggunakan dig, nslookup, dan host untuk memeriksa catatan DNS, melacak jalur resolusi, dan menemukan kesalahan konfigurasi. Kamu berlatih Linux Networking & TCP/IP for Developers dengan kode praktik yang langsung kamu jalankan di browser, dan tutor AI 24/7 menjawab pertanyaanmu saat kamu mengerjakan pelajaran ini.

Apakah aku perlu pengalaman untuk memulai Linux Networking & TCP/IP for Developers?

Tidak diperlukan pengalaman sebelumnya. Linux Networking & TCP/IP for Developers di CoddyKit dirancang untuk pemula hingga pelajar tingkat lanjut, jadi kamu bisa memulai di sini atau dari awal dan belajar sesuai kecepatan kamu sendiri. Ini adalah pelajaran 4 dari 4.

Berapa lama pelajaran “Diagnostik DNS dengan dig dan nslookup” memakan waktu?

Sebagian besar pelajaran CoddyKit memakan waktu sekitar 5–10 menit. Setiap pelajaran ringkas dan interaktif, jadi kamu membuat kemajuan stabil dan melanjutkan dari tempat kamu tinggalkan di web dan aplikasi.

Bisakah aku menulis dan menjalankan kode dalam pelajaran Linux Networking & TCP/IP for Developers ini?

Ya. Setiap pelajaran Linux Networking & TCP/IP for Developers menyertakan editor kode bawaan, jadi kamu menulis dan menjalankan kode nyata langsung di browser dan mendapatkan umpan balik AI instan — tidak diperlukan penyiapan lokal.

Semua pelajaran dalam kursus ini

  1. Menangkap Paket dengan Wireshark/tcpdump
  2. Alat Kinerja Jaringan
  3. Tembok Api Linux (Netfilter/iptables)
  4. Diagnostik DNS dengan dig dan nslookup
← Kembali ke Linux Networking & TCP/IP for Developers