<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Roman</title>
    <description>The latest articles on DEV Community by Roman (@r0men_).</description>
    <link>https://dev.to/r0men_</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3938619%2F52fc1df1-199d-459d-9573-c3a9cf9b178c.jpg</url>
      <title>DEV Community: Roman</title>
      <link>https://dev.to/r0men_</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/r0men_"/>
    <language>en</language>
    <item>
      <title>Understanding `dig`: How to Actually Read DNS Query Output</title>
      <dc:creator>Roman</dc:creator>
      <pubDate>Thu, 27 Aug 2026 15:12:38 +0000</pubDate>
      <link>https://dev.to/r0men_/understanding-dig-how-to-actually-read-dns-query-output-4bld</link>
      <guid>https://dev.to/r0men_/understanding-dig-how-to-actually-read-dns-query-output-4bld</guid>
      <description>&lt;p&gt;If you've ever stared at the output of &lt;code&gt;dig example.com&lt;/code&gt; and only understood half of it, you're not alone. &lt;code&gt;dig&lt;/code&gt; (Domain Information Groper) is the tool most sysadmins and DevOps engineers reach for first when a domain "isn't resolving" — but its output is dense, and knowing which line actually matters saves a lot of guessing.&lt;/p&gt;

&lt;p&gt;Here's a quick breakdown of what a &lt;code&gt;dig&lt;/code&gt; response is telling you and how to use it for real troubleshooting.&lt;/p&gt;

&lt;h2&gt;
  
  
  The four things &lt;code&gt;dig&lt;/code&gt; output actually tells you
&lt;/h2&gt;

&lt;p&gt;A &lt;code&gt;dig&lt;/code&gt; response is split into sections, each answering a different question:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;HEADER&lt;/strong&gt; — the response status (&lt;code&gt;NOERROR&lt;/code&gt;, &lt;code&gt;NXDOMAIN&lt;/code&gt;, &lt;code&gt;SERVFAIL&lt;/code&gt;) plus flags like &lt;code&gt;aa&lt;/code&gt; (authoritative) and &lt;code&gt;rd&lt;/code&gt;/&lt;code&gt;ra&lt;/code&gt; (recursion desired/available).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;QUESTION SECTION&lt;/strong&gt; — confirms exactly what was asked.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ANSWER SECTION&lt;/strong&gt; — the actual record returned, in &lt;code&gt;name TTL class type value&lt;/code&gt; format.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Query time / SERVER / WHEN&lt;/strong&gt; — how fast the resolver answered, and which resolver it was.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The status code alone usually tells you what's wrong before you read anything else:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;NOERROR&lt;/code&gt; + empty answer → the domain exists, but has no record of the type you asked for.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;NXDOMAIN&lt;/code&gt; → the domain doesn't exist — typo, expired registration, or a deleted zone.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;SERVFAIL&lt;/code&gt; → the authoritative name servers themselves are broken. That's a registrar/DNS-provider problem, not something on your end.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Picking the right record type
&lt;/h2&gt;

&lt;p&gt;A domain doesn't have one DNS record — it has several, and &lt;code&gt;dig&lt;/code&gt; needs to know which one you're asking for:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;A&lt;/code&gt; / &lt;code&gt;AAAA&lt;/code&gt; — the IPv4/IPv6 address.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;MX&lt;/code&gt; — mail server routing and priority. First thing to check when email bounces.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;TXT&lt;/code&gt; — SPF, DKIM, and domain-ownership verification strings.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;NS&lt;/code&gt; — the authoritative name servers. Wrong here means nothing else resolves correctly.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;CNAME&lt;/code&gt; — an alias pointing one hostname at another.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;SOA&lt;/code&gt; — primary name server, admin contact, zone refresh/retry/expire timers.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;PTR&lt;/code&gt; — reverse lookup (IP → hostname). Query format is different — more on that below.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  &lt;code&gt;+short&lt;/code&gt;: skip the noise
&lt;/h2&gt;

&lt;p&gt;Once you know what you're looking for, &lt;code&gt;dig example.com A +short&lt;/code&gt; strips the response down to bare values — just the IPs, one per line. No header, no timing info, nothing else.&lt;/p&gt;

&lt;h2&gt;
  
  
  Querying a specific resolver
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;dig @1.1.1.1 example.com A&lt;/code&gt; sends the query straight to a specific resolver instead of your system default. This is the fastest way to explain "it works for them but not for me" — DNS changes don't propagate everywhere simultaneously, and your ISP's resolver may be serving a stale cached record while a public resolver already reflects the update. Querying two &lt;code&gt;@server&lt;/code&gt;s side by side turns a mystery into "oh, it's just caching."&lt;/p&gt;

&lt;h2&gt;
  
  
  The PTR gotcha
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;dig 203.0.113.10 PTR&lt;/code&gt; doesn't work the way you'd expect, because PTR records live under a reversed, special-purpose domain: &lt;code&gt;10.113.0.203.in-addr.arpa&lt;/code&gt;. If a reverse lookup returns &lt;code&gt;NXDOMAIN&lt;/code&gt; for an IP you &lt;em&gt;know&lt;/em&gt; is active, check the octet order before assuming reverse DNS isn't configured.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;code&gt;dig&lt;/code&gt; vs &lt;code&gt;whois&lt;/code&gt; vs &lt;code&gt;host&lt;/code&gt;
&lt;/h2&gt;

&lt;p&gt;They answer different questions, and mixing them up wastes time:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;dig&lt;/code&gt; — what does this domain resolve to &lt;em&gt;right now&lt;/em&gt;, according to this resolver.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;host&lt;/code&gt; — the same core answer, shorter and more script-friendly.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;whois&lt;/code&gt; — who registered the domain and when it expires. Registration metadata, not live DNS.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Two real troubleshooting patterns
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;"We updated DNS an hour ago and some people still see the old value."&lt;/strong&gt; Query against two different &lt;code&gt;@server&lt;/code&gt;s. If they disagree, it's propagation/caching — wait out the TTL rather than touching the config again.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;"Email is bouncing."&lt;/strong&gt; &lt;code&gt;dig yourdomain.com MX +short&lt;/code&gt; first. If it's empty, mail has nowhere to go. If MX is fine, check &lt;code&gt;TXT&lt;/code&gt; next — a missing or malformed SPF record is a very common silent-bounce cause.&lt;/p&gt;




&lt;h3&gt;
  
  
  Read more / try it live
&lt;/h3&gt;

&lt;p&gt;This post covers the basics — the full guide goes deeper into DNSSEC validation (&lt;code&gt;+dnssec&lt;/code&gt;), why &lt;code&gt;+trace&lt;/code&gt; isn't always the tool you want, and includes a live sandboxed &lt;code&gt;dig&lt;/code&gt; you can actually run against a real domain, right in the browser, with no install:&lt;/p&gt;

&lt;p&gt;👉 &lt;strong&gt;&lt;a href="https://linuxcli.xyz/commands/dns/dig" rel="noopener noreferrer"&gt;Read the full dig command guide&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>dns</category>
      <category>linux</category>
      <category>networking</category>
      <category>devops</category>
    </item>
  </channel>
</rss>
