nsl

0th

Percentile

Look up the IP Address by Hostname (on Unix-alikes)

Interface to the system gethostbyname, currently available only on unix-alikes, i.e., not on Windows.

Keywords
utilities
Usage
nsl(hostname)
Arguments
hostname

the name of the host.

Details

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.

This function is not available on Windows.

Value

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

Aliases
  • nsl
Examples
library(utils) # NOT RUN { if(.Platform$OS.type == "unix") # includes Mac print( nsl("www.r-project.org") ) # }
Documentation reproduced from package utils, version 3.6.1, License: Part of R 3.6.1

Community examples

Looks like there are no examples yet.