title: Domain name existence via "dig"
body: <p>Would it be possible to check a domain name its existence by checking the output of "dig"?
  Inside the bind sources I found these constants:</p>
  
  <pre><code>0 DNS_R_NOEROR
  1 DNS_R_FORMERR
  2 DNS_R_SERVFAIL
  3 DNS_R_NXDOMAIN
  4 DNS_R_NOTIMP
  5 DNS_R_REFUSED
  6 DNS_R_YXDOMAIN
  7 DNS_R_YXRRSET
  8 DNS_R_NXRRSET
  9 DNS_R_NOTAUTH
  10 DNS_R_NOTZONE
  16 DNS_R_BADVERS
  
  &lt;RCODE 11&gt;     # 11 has no macro
  &lt;RCODE 12&gt;     # 12 has no macro
  &lt;RCODE 13&gt;     # 13 has no macro
  &lt;RCODE 14&gt;     # 14 has no macro
  &lt;RCODE 15&gt;     # 15 has no macro
  </code></pre>
  
  <p>In my opinion NOERROR &amp; SERVFAIL means the hostname exists (although it doesn't mean an ip is linked to it). NXDOMAIN would mean it absolutely not exists.</p>
  
  <p>I prefer not to use whois because it is quite slow. dig is much faster as I just need to be certain that the hostname doesn't exist yet.</p>
  
  <p>Could someone shine their light on my assumptions and the other macros?</p>
  
  <p>Thanks</p>