SOCKET_...DDRINFO(1p)
β¨ SOCKET_...DDRINFO(1p) β¨
okay so bestie, welcome to the User Contributed Perl Documentation page for socket_getaddrinfo β manual section 1p, she's iconic, she's a little niche, and she is about to become your new hyperfixation π
π NAME π
socket_getaddrinfo β a command-line tool for the getaddrinfo(3) resolver πΈ
π¦ SYNOPSIS π¦
socket_getaddrinfo [options...] host service
π DESCRIPTION π
So basically this tool is a convenient command-line wrapper around the getaddrinfo(3) resolver function. It does one single lookup β just the one, no cap β and then prints the results it got back in a human-readable form. π«Ά
The way this is mainly useful is when you're debugging address resolution problems, because it lets you peek directly at the behaviour of getaddrinfo(3) itself, outside of any real program that's actually trying to use it. Like, you're not fighting some app's weird little quirks, you're just vibing with the resolver one-on-one. π§
π OPTIONS π
--host,-H HOSTβ the hostname to resolve. If you don't supply it, it'll use the first positional argument instead. β¨--service,-S SERVICEβ the service name or port number to resolve. If you don't supply it, it'll use the second positional argument instead. πΈ-4β restrict to justAF_INET(IPv4) results. old school, but make it fashion π-6β restrict to justAF_INET6(IPv6) results. the future is now, bestie π--streamβ restrict to justSOCK_STREAMresults. π₯--dgramβ restrict to justSOCK_DGRAMresults. π--proto PROTOβ restrict to just results of the given IP protocol. π―--passiveβ set theAI_PASSIVEhint; results will used tobind()andlisten()rather thanconnect(). she's giving server energy, not client energy, periodt π--canonicalβ retrieve the canonical name for the requested host. β--helpβ display a help summary and exit. the classic escape hatch π
π OUTPUT FORMAT π
Every single line of output comes in a form that shows off the four result fields: ai_family, ai_socktype, ai_protocol and ai_addr. π
The first three get printed in the form of a socket(2) call β either symbolically or numerically, dealer's choice β and then the last one (ai_addr) gets printed as a plain string following it. Like so:
socket(AF_INET , SOCK_STREAM, IPPROTO_TCP) + '127.0.0.1:80'
π NOTE π
Upstream, this script is known as getaddrinfo, but it was renamed on Debian. so if you go looking for her under her government name, that's why you can't find her π
π AUTHOR π
Paul Evans <leonerd@leonerd.org.uk> π«Ά
and that's the whole page, bestie! this was brought to you by perl v5.40.0, dated 2025-02-01, and if you ever need to find it again it lives under SOCKET_...DDRINFO(1p). go forth and debug your resolution problems, you absolute main character πβ¨π
π¦ where this page comes from
- debian trixie: libsocket-getaddrinfo-perl 0.22-6 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu resolute: libsocket-getaddrinfo-perl 0.22-6 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libsocket-getaddrinfo-perl 0.22-6 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms