Documentation ¶
Overview ¶
Package netaddrs provides a function to get IP addresses from a DNS request or by executing a binary.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IPAddrs ¶
IPAddrs looks up and returns IP addresses using the method described by cfg.
If cfg is a DNS name IP addresses are looked up by querying the default DNS resolver for A and AAAA records associated with the DNS name.
If cfg has an exec= prefix, IP addresses are looked up by executing the command after exec=. The command may include optional arguments. Command arguments must be space separated (spaces in argument values can not be escaped). The command may output IPv4 or IPv6 addresses, and IPv6 addresses can optionally include a zone index. The executable must follow these rules:
on success - exit 0 and print whitespace delimited IP addresses to stdout. on failure - exits with a non-zero code, and should print an error message of up to 1024 bytes to stderr.
Use ctx to cancel the operation or set a deadline.