# dns/reverse
Reverse-resolve an IP literal to a hostname (`getnameinfo`).
## Syntax
[dns/reverse $addr ?$opts]
## Parameters
- `$addr` — an IPv4 or IPv6 literal (string). Hostnames are rejected
- `$opts` — optional option map:
- `:numeric true` — format the literal instead of performing a PTR
lookup (never touches the network)
## Examples
[dns/reverse "8.8.8.8"] # => "dns.google" [dns/reverse "127.0.0.1" %{ :numeric true }] # => "127.0.0.1" [dns/reverse "::1" %{ :numeric true }] # => "::1"
## Returns
Hostname string, or `%Err{:message}` (including when the address has no
PTR record — the lookup uses `NI_NAMEREQD`).
## See Also
`dns/lookup`, `dns/parse`, `dns/ip?`