# dns/addr-info
Resolve a hostname to full `getaddrinfo` records — one map per address,
carrying the family/socket/protocol metadata `dns/lookup` discards.
## Syntax
[dns/addr-info $host ?$opts]
## Parameters
- `$host` — hostname or IP literal (string)
- `$opts` — optional option map; same keys as `dns/lookup`
(`:family`, `:socktype`, `:protocol`, `:flags`, `:port`, `:backend`)
## Examples
[dns/addr-info "example.com" %{ :port 443 }] # => @{ %{ :address "93.184.216.34" :family :ipv4 :socktype :stream # :protocol :tcp :port 443 } ... } [dns/addr-info "localhost" %{ :flags @{ :canonname } }] # => @{ %{ :address "127.0.0.1" :family :ipv4 :socktype :stream # :protocol :tcp :canonname "localhost" } ... }
## Returns
Vector of maps with:
| Key | Value |
|---|---|
| `:address` | address string (no port) |
| `:family` | `:ipv4`, `:ipv6`, or `:unix` |
| `:socktype` | `:stream`, `:dgram`, or `:any` |
| `:protocol` | `:tcp`, `:udp`, or `:any` |
| `:canonname` | canonical name, only when the resolver supplies one |
| `:port` | the requested `:port`, when given |
or `%Err{:message}`.
## Notes
`getaddrinfo` reports no TTL, so records carry none. `:canonname` is
normally present only when the `:canonname` flag was requested.
## See Also
`dns/lookup`, `net/connect`