This help topic is for R version 2.9.0. For the current version of R, try https://stat.ethz.ch/R-manual/R-patched/library/utils/html/nsl.html
nsl {utils}R Documentation

Look up the IP Address by Hostname

Description

Interface to gethostbyname.

Usage

nsl(hostname)

Arguments

hostname

the name of the host.

Value

The IP address, as a character string, or NULL if the call fails.

Note

This was included as a test of internet connectivity, to fail if the node running R is not connected. It will also return NULL if BSD networking is not supported, including the header file ‘arpa/inet.h’.

Examples

## Not run: nsl("www.r-project.org")

[Package utils version 2.9.0 ]