|
NAMEgetaddrinfo —
resolve names to socket addresses
SYNOPSIS
DESCRIPTIONThegetaddrinfo utility resolves host and service names
to socket addresses with
getaddrinfo(3)
and prints them to standard output in a user-friendly format.
The output is a sequence of lines with space-separated fields: socket-type address-family protocol
[af-specific data ...] For the “inet” and “inet6” address families, the af-specific data are the IP/IPv6 address and port number. Depending on the settings in
nsswitch.conf(5),
These options are available:
EXIT STATUSThegetaddrinfo utility exits 0 on success,
and >0 if an error occurs.
EXAMPLESLook up “www.NetBSD.org”:$ getaddrinfo www.NetBSD.org dgram inet6 udp 2001:4f8:3:7:2e0:81ff:fe52:9ab6 0 dgram inet udp 149.20.53.67 0 stream inet6 tcp 2001:4f8:3:7:2e0:81ff:fe52:9ab6 0 stream inet tcp 149.20.53.67 0 The port number here is zero because no service was specified. Look up “morden.NetBSD.org” for stream sockets on port 80, and show the canonical name: $ getaddrinfo -c -t stream -s 80 morden.NetBSD.org canonname ftp.NetBSD.org stream inet6 tcp 2001:470:1f05:3d::21 80 stream inet tcp 199.233.217.249 80 SEE ALSOdrill(1), getent(1), getaddrinfo(3), getnameinfo(3), resolver(3), hosts(5), nsswitch.conf(5), protocols(5), resolv.conf(5), services(5)HISTORYThegetaddrinfo command first appeared in
NetBSD 7.0.
Visit the GSP FreeBSD Man Page Interface. |