<h2><a name="p-32602-rponse-1" class="anchor" href="#p-32602-rponse-1" aria-label="Heading link"></a>Réponse</h2>
<p>The short answer to your specific question of listing CNAMEs is that you cannot without permission to do zone transfers (see <a href="https://serverfault.com/questions/16101/how-to-list-all-cname-records-for-a-given-domain">How to list all CNAME records for a given domain?</a>).</p>
<p>That said, if your company’s DNS server still supports the ANY query, you can use dig to list the other records by doing:</p>
<pre><code class="lang-auto">dig +noall +answer +multiline yourdomain.yourtld any
</code></pre>
<p>These … <code>+noall +answer +multiline</code> … are strictly optional and are simply output formatting flags to make the output more easily human readable (see <a href="https://linux.die.net/man/1/dig">dig man page</a>).</p>
<h2><a name="p-32602-example-2" class="anchor" href="#p-32602-example-2" aria-label="Heading link"></a>Example</h2>
<pre><code class="lang-auto">$ dig +noall +answer +multiline bad.horse any
</code></pre>
<p>Returns:</p>
<pre><code class="lang-auto">bad.horse. 7200 IN A 162.252.205.157
bad.horse. 7200 IN CAA 0 issue "letsencrypt.org"
bad.horse. 7200 IN CAA 0 iodef "mailto:abuse@sandwich.net"
bad.horse. 7200 IN MX 10 mx.sandwich.net.
bad.horse. 7200 IN NS a.sn1.us.
bad.horse. 7200 IN NS b.sn1.us.
bad.horse. 7200 IN SOA a.sn1.us. n.sn1.us. (
2017032202 ; serial
1200 ; refresh (20 minutes)
180 ; retry (3 minutes)
1209600 ; expire (2 weeks)
60 ; minimum (1 minute)
)
</code></pre>
<h2><a name="p-32602-caveats-rfc8482-3" class="anchor" href="#p-32602-caveats-rfc8482-3" aria-label="Heading link"></a>Caveats (RFC8482)</h2>
<p>Note that, <a href="https://datatracker.ietf.org/doc/html/rfc8482">since around 2019</a>, most public DNS servers have stopped answering most DNS <code>ANY</code> queries usefully. For background on that, see: <a href="https://blog.cloudflare.com/rfc8482-saying-goodbye-to-any/">RFC8482 - Saying goodbye to ANY</a></p>
<p>If <code>ANY</code> queries do not enumerate multiple records, the only option is to request each <a href="https://en.wikipedia.org/wiki/List_of_DNS_record_types">record type</a> (e.g. A, CNAME, or MX) individually.</p>