<?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="dnsipq">

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

<refnamediv>
<refname>dnsipq</refname>
<refpurpose>look up the IP address(es) of a domain name</refpurpose>
</refnamediv>

<refsynopsisdiv>
<cmdsynopsis>
<command>dnsipq</command>
<arg choice='req' rep='repeat'><replaceable>dn</replaceable></arg>
</cmdsynopsis>
</refsynopsisdiv>

<refsection>
<title>Description</title>

<para>
<command>dnsipq</command> first feeds <replaceable>dn</replaceable> through name qualification.
It then looks up A resource records for the result in the Domain Name System and prints the corresponding IP address(es) on a single line. 
If the qualified <replaceable>fqdn</replaceable> does not exist, <command>dnsipq</command> prints a blank line. 
You can list several <replaceable>dn</replaceable>s; <command>dnsipq</command> prints each result on a separate line.
</para>

<para>
Normally <command>dnsipq</command> exits 0. 
If it encounters a temporary problem that prevents it from determining the list of IP addresses, it prints an error message and exits 111.
</para>

<para>
<command>dnsipq</command> makes all DNS lookups using the locally configured DNS proxy server(s).
See <citerefentry><refentrytitle>djbdns-client</refentrytitle><manvolnum>5</manvolnum></citerefentry> for how this server is found, for how name qualification operates, and for certain <replaceable>dn</replaceable> values and standard domain names that short-circuit DNS lookups to the proxy DNS server(s) and possibly name qualification as well.
</para>

</refsection>

<refsection>
<title>See also</title>
<variablelist>
<varlistentry>
<term><citerefentry><refentrytitle>dnsip</refentrytitle><manvolnum>1</manvolnum></citerefentry></term>
<listitem><para>a similar tool that does not apply name qualification</para></listitem>
</varlistentry>
<varlistentry>
<term><citerefentry><refentrytitle>dnsname</refentrytitle><manvolnum>1</manvolnum></citerefentry></term>
<listitem><para>a tool that looks up the domain name(es) of an IP address</para></listitem>
</varlistentry>
</variablelist>
</refsection>

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

<para>
In the original Bernstein <command>dnsipq</command>, the mis-behaviour with stupid consequences and real-world liabilities of the original Bernstein DNS client library would occur.
This undocumented behaviour was removed in 2025 and is not present in this version of <command>dnsipq</command>.
</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>
