Last data update: 2014.03.03

R: Lookup a hostname
nslookupR Documentation

Lookup a hostname

Description

The 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. The has_internet function tests the internet connection by resolving a random address.

Usage

nslookup(host, error = TRUE)

has_internet()

Arguments

host

a string with a hostname

error

raise an error for failed DNS lookup. Otherwise returns NULL.

Examples

# Should always work if we are online
nslookup("www.r-project.org")

# If your OS supports IPv6
nslookup("ipv6.test-ipv6.com", error = FALSE)

Results