How to use dig
Comparable PowerShell Resolve-DnsName commands, though it&#x27;s not overall as capable:<p>Basic lookup against specific DNS server:<p><pre><code>    # dig @8.8.8.8 jvns.ca

    PS C:\&gt; Resolve-DnsName -Server 8.8.8.8 -Name jvns.ca

    Name                                           Type   TTL   Section    IPAddress
    ----                                           ----   ---   -------    ---------
    jvns.ca                                        AAAA   300   Answer     2606:4700:3031::ac43:b35a
    jvns.ca                                        AAAA   300   Answer     2606:4700:3033::6815:5bce
    jvns.ca                                        A      300   Answer     104.21.91.206
    jvns.ca                                        A      300   Answer     172.67.179.90
</code></pre>
Lookup NS type only:<p><pre><code>    # dig ns jvns.ca

    PS C:\&gt; Resolve-DnsName -Name jvns.ca -Type NS

    Name                           Type   TTL   Section    NameHost
    ----                           ----   ---   -------    --------
    jvns.ca                        NS     20944 Answer     art.ns.cloudflare.com
    jvns.ca                        NS     20944 Answer     roxy.ns.cloudflare.com

    or

    PS C:\&gt; Resolve-DnsName jvns.ca NS
</code></pre>
Reverse lookup:<p><pre><code>    # dig -x 172.217.13.174
    
    PS C:\&gt; Resolve-DnsName -Server 8.8.8.8 -Name 172.217.13.174
    
    Name                           Type   TTL   Section    NameHost
    ----                           ----   ---   -------    --------
    174.13.217.172.in-addr.arpa    PTR    21600 Answer     yul03s04-in-f14.1e100.net
</code></pre>
Reverse lookup using PTR type (it will tab-complete through the available -Type options):<p><pre><code>    PS C:\&gt; Resolve-DnsName -server 8.8.8.8 -Name 174.13.217.172.in-addr.arpa -Type PTR
    
    Name                           Type   TTL   Section    NameHost
    ----                           ----   ---   -------    --------
    174.13.217.172.in-addr.arpa    PTR    21131 Answer     yul03s04-in-f14.1e100.net
</code></pre>
The output isn&#x27;t actually a text table, it&#x27;s an array of objects, so it&#x27;s easy to filter and extract data without text parsing:<p><pre><code>    PS C:\&gt; resolve-dnsname google.com ns |% namehost
    ns3.google.com
    ns1.google.com
    ns4.google.com
    ns2.google.com
    </code></pre>
There&#x27;s also `-TCPOnly`, `-NoRecursion`, `-NoHostsFile` and other options.<p>NB. you can get BIND for Windows, and therefore dig.exe for Windows, at <a href="https:&#x2F;&#x2F;www.isc.org&#x2F;download&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.isc.org&#x2F;download&#x2F;</a>