hostname2ip {getip} | R Documentation |
hostname2ip
Description
Converts a hostname (or vector of hostnames) to
Usage
hostname2ip(hosts)
Arguments
hosts |
A vector of hostnames as strings (or just one). |
Details
Only IPv4 addresses will be returned. If only IPv6 addresses exist (and if
that is the case, allow me to be the first to greet you, person from the
distant future) then NA
is returned for that hostname.
The function uses getaddrinfo()
on *NIX systems, and
gethostbyname()
on Windows.
Value
A list of vectors of IP's. Each IP is stored as a string.
Examples
library(getip)
hosts = c("www.google.com", "localhost", "www.yahoo.com")
hostname2ip(hosts)
[Package getip version 0.1-4 Index]