Add reference to nss-icmp.
[icmp-dn.git] / src / idnlookup.1
CommitLineData
c596f1f3 1.\"
2.\" Copyright (c) 2005 Fredrik Tolf <fredrik@dolda2000.com>
3.\"
4.\" This is free documentation; you can redistribute it and/or
5.\" modify it under the terms of the GNU General Public License as
6.\" published by the Free Software Foundation; either version 2 of
7.\" the License, or (at your option) any later version.
8.\"
9.\" The GNU General Public License's references to "object code"
10.\" and "executables" are to be interpreted as the output of any
11.\" document formatting or typesetting system, including
12.\" intermediate and printed output.
13.\"
14.\" This manual is distributed in the hope that it will be useful,
15.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
16.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17.\" GNU General Public License for more details.
18.\"
19.\" You should have received a copy of the GNU General Public
20.\" License along with this manual; if not, write to the Free
21.\" Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111,
22.\" USA.
23.\"
3c31159f 24.TH IDNLOOKUP 1 "12 Jan 2006" "icmpdn 0.3" "ICMP Hostname Manual"
c596f1f3 25.SH NAME
26idnlookup \- ICMP domain name resolver
27.SH SYNOPSIS
28.B idnlookup
29[ \fB-ahT\fP ] [ \fB-t\fP \fItimeout\fP ] \fIhostname\fP
30.SH DESCRIPTION
31\fBidnlookup\fP is a utility to ask an Internet host for its fully
32qualified domain name over ICMP. If successful, it will print the
33host's domain name to standard output.
34.P
35\fIhostname\fP is the address of the Internet host to query. It can be
36either a symbolic hostname, an IPv4 address in decimal notation, or an
37IPv6 address in hexadecimal notation. If a symbolic hostname is
38specified, all its addresses are looked up and tried in order.
39.P
40The remote host must be running software which can respond to the
41requests for hostname. To the knowledge of the author, current
42BSD-based systems can do this in the kernel. Linux systems must, as of
43this writing, be running \fBicmpdnd\fP(8).
44.SH EXIT STATUS
45\fBidnlookup\fP will return 0 if the specified host was succesfully
46queried. If illegal arguments were given, or if the host could, for
47any reason, not be queried, or if another error occurred, it will
48return 1.
49.SH OPTIONS
50.TP
51.B -a
52Normally, \fBidnlookup\fP will only print the first name that the host
53returns. This option will cause all names to be printed, one per
54line.
55.TP
56.B -h
57Print a brief usage message and exit.
58.TP
59.B -T
60Write the time-to-live in seconds that the remote host suggests on the
61first line, before any names.
62.TP
63.B -t
64Print an error message and exit if the remote host does not reply in
65\fItimeout\fP milliseconds. The default is 3 seconds. Note that this
66timeout will apply to all addresses, in case a symbolic hostname
67resolves to more than one address.
68.SH SECURITY
69Since \fBidnlookup\fP uses ICMP, it needs to run as root. Normally, it
70should be installed set-uid root in order for any user to be able to
71ask hosts for their names. Although the author believes
72\fBidnlookup\fP to be safe to install as set-uid root, he makes no
73guarantees.
74.SH BUGS
75\fBidnlookup\fP does not yet implement domain name decompression, and
76as such will scream and die at the sight of such names. This is
77because the author is not sure from which point in the ICMP datagrams
78the offsets specified in compressed domain names is to be counted. If
79you have information on this, please mail the author. Until then, this
80bug will hopefully not pose any large problems, since probably only
81very few hosts will return more than one name, and then there is
82little chance to compress it.
83.P
84b4260a 84Some GNU/Linux distributions still ship with a GNU C library
85implementation that has a bug in the implementation of
c596f1f3 86\fBgetaddrinfo\fP(3), which may cause addresses resolved from a
87symbolic hostname to be returned in the wrong order (i.e. not
88consistent with RFC 3484). This will in turn cause \fBidnlookup\fP to
89try addresses in the wrong order, if the hostname in question triggers
90the \fBgetaddrinfo\fP(3) bug. This will normally not pose a problem,
91but not too uncommonly, this will cause IPv4 addresses to be sorted
92before IPv6 addresses. If the remote host listens for ICMP hostname
93requests only on IPv6 (or if the Internet service provider for the
94remote host blocks ICMP packets, which is wrong, but unfortunately not
95all too uncommon), \fBidnlookup\fP will have to time out on the IPv4
84b4260a 96address before being able to query the IPv6 address. This bug has been
97fixed since, but as of this writing, only a few systems run the fixed
98version of glibc.
c596f1f3 99.SH AUTHOR
100Fredrik Tolf <fredrik@dolda2000.com>
101.SH SEE ALSO
7eb6bbee 102\fBicmpdnd\fP(8), \fBnss-icmp\fP(7), \fIRFC 1788\fP