getaddrinfo()
likely does make a connect()
call behind the scenes, however it already knows the IP address of the DNS server it needs to connect to in order to query for the address of the host you are asking it to query for.
getaddrinfo()
is only needed if you want to map "www.somehost.com" to an IP address, it's not needed as a primer to call connect()
.
You can probably find the complete source code for getaddrinfo()
in glibc sources which you'd be able to find here (among other places).
Hope that clarifies things for you.