TCP/IP connectivity files

When you configure the database server to use the TCP/IP network protocol, you use information from the hosts and services files to prepare the sqlhosts information.

The hosts file requires a single entry for each network-controller card that connects a computer running Informix® client/server products on the network. Each entry in the file contains the IP address (or ethernet card address) and host name. You can also include the host alias. Although the length of the host name is not limited in the hosts file, the Informix® database server limits the host name to 256 bytes.

The following example has two entries.
#address       hostname  alias
98.555.43.21   odyssey   
12.34.56.555   illiad    sales
The services file contains an entry for each service available through TCP/IP. Each entry is a single line that contains the following information:
  • Service name

    Informix® products use this name to determine the port number and protocol for making client/server connections. The service name is limited to 128 bytes.

  • Port number and connection protocol, separated by a forward slash ( / ) character

    The port number is the computer port, and the protocol for TCP/IP is tcp.

    The operating system imposes restrictions on the port number. User informix must use a port number equal to or greater than 1024. Only root users are allowed to use a port number lower than 1024.

  • Host Aliases (optional)
The service name and port number are arbitrary. However, they must be unique within the context of the file and must be identical on all the computers running Informix® client/server products. The following example has one entry:
#servicename   port/protocol
server2        1526/tcp

This entry makes server2 known as the service name for TCP port 1526. A database server can then use this port to service connection requests.

Important: For database servers that communicate with other database servers, you must define either a TCP/IP connection or an IPCSTR (interprocess communications stream pipe) connection for the DBSERVERNAME configuration parameter. You can also define at least one DBSERVERALIASES configuration parameter setting with the appropriate connection protocol for connectivity between the coordinator and the subordinate servers. For cross-server transactions, each participating server must support a TCP/IP or an IPCSTR connection with the coordinator, even if both database server instances are on the same workstation.
You typically include a separate NETTYPE parameter for each connection type that is associated with a dbserver name. You list dbserver name entries in the DBSERVERNAME and DBSERVERALIASES configuration parameters. You associate connection types with dbserver names through entries in the sqlhosts file or registry.

The hosts and services files must be available to each computer that runs Informix® client/server products.

UNIX:
  • The hosts and services files are in the /etc directory.
  • On systems that use NIS, the hosts and services files are maintained on the NIS server. The hosts and services files that are on your local computer might not be used and might not be up to date. To view the contents of the NIS files, enter the following commands on the command line:
    ypcat hosts 
    ypcat services
Windows:
  • The hosts and services files are in %WINDIR%\system32\drivers\etc\.
  • You might want to configure TCP/IP to use the Domain Name Service (DNS) for host name resolutions.
  • The Dynamic Host Configuration Product (DHCP) dynamically assigns IP addresses from a pool of addresses instead of using IP addresses that are explicitly assigned to each workstation. If your system uses DHCP, Windows Internet Name Service (WINS) is required. DHCP is transparent to the database server.