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

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

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

<refsynopsisdiv>
<cmdsynopsis>
<command>dnsip</command>
<arg choice='req' rep='repeat'><replaceable>fqdn</replaceable></arg>
</cmdsynopsis>
</refsynopsisdiv>

<refsection>
<title>Description</title>

<para>
<command>dnsip</command> looks up A resource records for <replaceable>fqdn</replaceable> in the Domain Name System and prints the IP address(es) of <replaceable>fqdn</replaceable> on a single line. 
If <replaceable>fqdn</replaceable> does not exist, <command>dnsip</command> prints a blank line. 
You can list several <replaceable>fqdn</replaceable>s; <command>dnsip</command> prints each result on a separate line.
</para>

<para>
Normally <command>dnsip</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>dnsip</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, and for certain standard domain names that short-circuit DNS lookups to the proxy DNS server(s).
</para>

</refsection>

<refsection>
<title>See also</title>
<variablelist>
<varlistentry>
<term><citerefentry><refentrytitle>dnsipq</refentrytitle><manvolnum>1</manvolnum></citerefentry></term>
<listitem><para>a similar tool that also applies 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>dnsip</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>dnsip</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>dnsip</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>
