Network operations: ping, DNS, TCP port checks.
Summary
Functions
Sends ICMP ping to a host.
Checks if a TCP port is open on a host.
Resolves a hostname to a list of IP addresses.
Scans a list of TCP ports on a host.
Types
Functions
Sends ICMP ping to a host.
Returns :ok on success or {:error, reason} on failure.
Options
:count— number of echo requests (default: 3):timeout— timeout in ms (default: 5_000)
Checks if a TCP port is open on a host.
Options
:timeout— connection timeout in ms (default: 5_000)
Resolves a hostname to a list of IP addresses.
Returns {:ok, [String.t()]} or {:error, :nxdomain} on failure.
@spec scan_ports(String.t(), [tcp_port()], keyword()) :: %{ required(tcp_port()) => :open | :closed }
Scans a list of TCP ports on a host.
Returns a map of port → :open | :closed.