1% File src/library/utils/man/unix/nsl.Rd
2% Part of the R package, https://www.R-project.org
3% Copyright 1995-2018 R Core Team
4% Distributed under GPL 2 or later
5
6\name{nsl}
7\alias{nsl}
8\title{Look up the IP Address by Hostname (on Unix-alikes)}
9\description{
10  Interface to the system \command{gethostbyname}, currently available
11  only on unix-alikes, i.e., not on Windows.
12}
13\usage{
14nsl(hostname)
15}
16\arguments{
17 \item{hostname}{the name of the host.}
18}
19\value{
20  The IP address, as a character string, or \code{NULL} if the call fails.
21}
22\details{
23  This was included as a test of internet connectivity, to fail if
24  the node running \R is not connected.  It will also return \code{NULL}
25  if BSD networking is not supported, including the header file
26  \file{arpa/inet.h}.
27
28  This function is not available on Windows.
29}
30\examples{
31if(.Platform$OS.type == "unix") # includes Mac
32  print( nsl("www.r-project.org") )
33}
34\keyword{utilities}
35