nslookup function is similar to
nsl but works on all platforms
and can resolve ipv6 addresses if supported by the OS. Default behavior raises an
error if lookup fails.
nslookup(host, ipv4_only = FALSE, multiple = FALSE, error = TRUE) has_internet()
a string with a hostname
always return ipv4 address. Set to `FALSE` to allow for ipv6 as well.
returns multiple ip addresses if possible
raise an error for failed DNS lookup. Otherwise returns
has_internet function tests for internet connectivity by performing a
dns lookup. If a proxy server is detected, it will also check for connectivity by
connecting via the proxy.
# Should always work if we are online nslookup("www.r-project.org")#>  "22.214.171.124"# If your OS supports IPv6 nslookup("ipv6.test-ipv6.com", ipv4_only = FALSE, error = FALSE)#> NULL