<?xml version="1.0" encoding="UTF-8"?>
<!-- **************************************************************************
.... For copyright and licensing terms, see the file named COPYING.
.... **************************************************************************
.-->
<?xml-stylesheet href="docbook-xml.css" type="text/css"?>

<refentry id="dnsqr">

<refmeta xmlns:xi="http://www.w3.org/2001/XInclude">
<refentrytitle>dnsqr</refentrytitle>
<manvolnum>1</manvolnum>
<refmiscinfo class="manual">user commands</refmiscinfo>
<refmiscinfo class="source">djbwares</refmiscinfo>
<xi:include href="version.xml" />
</refmeta>

<refnamediv>
<refname>dnsqr</refname>
<refpurpose>query a proxy DNS server using the DNS protocol</refpurpose>
</refnamediv>

<refsynopsisdiv>
<cmdsynopsis>
<command>dnsqr</command>
<arg choice='req'><replaceable>t</replaceable></arg>
<arg choice='req'><replaceable>fqdn</replaceable></arg>
</cmdsynopsis>
</refsynopsisdiv>

<refsection>
<title>Description</title>

<para>
<command>dnsqr</command> looks up resource records of type <replaceable>t</replaceable> for <replaceable>fqdn</replaceable> by making a Domain Name System request to the configured local proxy DNS server(s).
It prints the results in a human-readable format, more compact than the <citerefentry><refentrytitle>dig</refentrytitle><manvolnum>1</manvolnum></citerefentry> output format.
</para>

<para>
It expects to query a proxy DNS server, and the request is marked as recursive.
<replaceable>t</replaceable> may be a name or a number.
Currently recognized names are:
<code>any</code>,
<code>a</code>,
<code>ns</code>,
<code>mx</code>,
<code>ptr</code>,
<code>txt</code>,
<code>cname</code>,
<code>soa</code>,
<code>loc</code>,
<code>hinfo</code>,
<code>rp</code>,
<code>sig</code>,
<code>key</code>,
<code>aaaa</code>,
<code>axfr</code>, and
<code>srv</code>.
</para>

<para>
<command>dnsqr</command> makes all DNS lookups using the locally configured DNS proxy server(s), and performs no name qualification on what is taken to already be a "fully-qualified" domain name (trailing dot or no) <replaceable>fqdn</replaceable>.
See <citerefentry><refentrytitle>djbdns-client</refentrytitle><manvolnum>5</manvolnum></citerefentry> for how this server is found.
</para>

<caution>
<command>dnsqr</command> is a diagnostic tool, and thus permits using improper values of <replaceable>t</replaceable>.
</caution>

<note>
<command>dnsqr</command> <arg choice='plain'>axfr</arg>, <command>dnsqr</command> <arg choice='plain'>any</arg>, and <command>dnsqr</command> <arg choice='plain'>opt</arg> simulate things that valid DNS clients will not actually do.
See RFC 8482 for the particular case of <arg choice='plain'>any</arg> passing into desuetude, and RFC 6891 for why <arg choice='plain'>opt</arg> is never a valid client query type.
</note>

<note>
Because <command>dnsqr</command> is a diagnostic tool, certain standard <replaceable>fqdn</replaceable>s, that normally short-circuit DNS lookups to the proxy DNS server(s) inside the DNS client library, will not do so and will instead generate query traffic for domain names that are in normal operation not queried.
<citerefentry><refentrytitle>dnscache</refentrytitle><manvolnum>1</manvolnum></citerefentry> synthesizes much the same fixed responses to these queries as the DNS client library itself synthesizes.
Other proxy DNS servers (and indeed the original Bernstein <citerefentry><refentrytitle>dnscache</refentrytitle><manvolnum>1</manvolnum></citerefentry>) may not do, and may generate bogus traffic to the public "<code>.</code>" content DNS servers and other content DNS servers, yielding possibly bogus answers.
</note>

</refsection>

<refsection>
<title>See also</title>
<variablelist>
<varlistentry>
<term><citerefentry><refentrytitle>dnsq</refentrytitle><manvolnum>1</manvolnum></citerefentry></term>
<listitem><para>a similar tool that makes requests to content DNS servers</para></listitem>
</varlistentry>
<varlistentry>
<term><citerefentry><refentrytitle>tinydns-get</refentrytitle><manvolnum>1</manvolnum></citerefentry></term>
<listitem><para>a tool that makes direct queries against a content DNS server's database</para></listitem>
</varlistentry>
</variablelist>
</refsection>

<refsection>
<title>History</title>
<para>
<command>dnsqr</command> was originally part of <personname><firstname>Daniel</firstname> <othername>J.</othername> <surname>Bernstein</surname></personname>'s djbdns toolset in 1999.
</para>
</refsection>

<refsection>
<title>Author</title>
<para>
Original code and documentation by <personname><firstname>Daniel</firstname> <othername>J.</othername> <surname>Bernstein</surname></personname>.
Documentation modernizations by <personname><firstname>Jonathan</firstname> <surname>de Boyne Pollard</surname></personname>.
</para>
</refsection>

</refentry>
