| 12
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 
 | Since version 0.20, upstream have distributed getnameinfo and getaddrinfo
as scripts in the bin directory. Superficially the functionality of these
scripts is a subset of that provided by 'dig' and 'nslookup'.
However this is not really correct. 'dig' and 'nslookup' are both DNS clients;
they directly talk DNS to diagnose DNS problems.
The utility of these utilities, however, is that they provide a shell
output showing _exactly_ what a normal userland binary would do to
resolve hostnames into addresses or vice versa; INCLUDING the IPv4/IPv6
ordering, or for example /etc/hosts. This ordering can be the subject of many
subtle bugs in connections, either causing timeouts, delays, or outright
failures. It is useful to have a commandline debug tool for getaddrinfo(3) in
such scenarios. Neither 'dig' nor 'nslookup' can be of any help diagnosing
these problems.
In Debian, these scripts have been renamed as follows:
socket_getaddrinfo - look up address from host name
socket_getnameinfo - look up name from address
$ socket_getaddrinfo --passive --service 8034
Resolved host '', service '8034'
socket(AF_INET , SOCK_STREAM, IPPROTO_TCP) + '0.0.0.0:8034'
socket(AF_INET , SOCK_DGRAM , IPPROTO_UDP) + '0.0.0.0:8034'
socket(AF_INET , SOCK_RAW   , IPPROTO_IP ) + '0.0.0.0:8034'
socket(AF_INET6, SOCK_STREAM, IPPROTO_TCP) + '[::]:8034'
socket(AF_INET6, SOCK_DGRAM , IPPROTO_UDP) + '[::]:8034'
socket(AF_INET6, SOCK_RAW   , IPPROTO_IP ) + '[::]:8034'
$ socket_getaddrinfo --service 8034
Resolved host '', service '8034'
socket(AF_INET6, SOCK_STREAM, IPPROTO_TCP) + '[::1]:8034'
socket(AF_INET6, SOCK_DGRAM , IPPROTO_UDP) + '[::1]:8034'
socket(AF_INET6, SOCK_RAW   , IPPROTO_IP ) + '[::1]:8034'
socket(AF_INET , SOCK_STREAM, IPPROTO_TCP) + '127.0.0.1:8034'
socket(AF_INET , SOCK_DGRAM , IPPROTO_UDP) + '127.0.0.1:8034'
socket(AF_INET , SOCK_RAW   , IPPROTO_IP ) + '127.0.0.1:8034'
 |