|  Chapter Contents |  Previous |  Next | 
| Network Administration | 
Under the UNIX environment, the 
gethostbyname
 and 
gethostbyaddr
 routines may use the 
/etc/hosts
 file, or
they may call the resolver
to contact the name server for the host name information.
The SAS/C Socket Library uses the following logic when looking up host names and addresses:
/etc/resolv.conf
 file using the rules listed in /etc/resolv.conf. If the
socket library finds
the 
/etc/resolv.conf
 file,
it performs the requested queries through the resolver, and it returns any
answer it receives. If attempts to connect to name servers are refused (
errno
 
ECONNREFUSED
), it goes to step 3.
TCPIP_DATA
 string. If found, the string is passed
to 
fopen
fopen
TCPIP_PREFIX
 and then searches for
tcpip_prefix.TCPIP.DATA
TCPIP_PREFIX
 and searches for
default-value.TCPIP.DATA
/etc/hosts
 file using the rules listed in /etc/hosts.  If the
socket library finds an 
/etc/hosts
 file, it returns the result, including failure.
Determining the domain name in name-server queries follows
the same logic as the UNIX operating system in using the 
domain 
statement of the 
/etc/resolv.conf
 file, the file specified by
the 
HOSTALIASES
 environment
variable and the value of the 
LOCALDOMAIN
 environment variable. Name-server addresses are also determined
from the 
/etc/resolv.conf
file.
If, because there is no 
/etc/resolv.conf
 file, an IBM TCP/IP TCPIP.DATA file is read, resolver
configuration is determined by the statements, including IBM defaults, in
the TCPIP.DATA file. The SAS/C Library only recognizes the first three name
servers specified in this file. Both the UNIX operating system and the SAS/C
environment have a limit of three name servers. 
|  Chapter Contents |  Previous |  Next |  Top of Page | 
Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.