When a client, or a server acting as a client, connects to a server it:
Determines the name of the server either programmatically or by referring to the DSQUERY environment variable. If the application user has not set DSQUERY, the runtime value for the server name defaults to the SYBASE environment variable.
Looks in the interfaces file for an entry whose name matches the name of the server, stops at the first instance of that name, and reads the query line.
Uses the network information provided by the query line to connect to the server. If the client cannot connect the first time, it makes additional attempts according to the delay and retry numbers indicated in the interfaces file. If no matching entry is found, an error message is written to the client’s standard error file. If multiple networks are supported, the client attempts to connect using the information in the second query entry for the server. See “Configuring for query port backup”.
The Open Client documentation discusses client connections in much greater detail. See the Open/Client Programmer’s Supplement for your client platform or the appropriate Open/Client documentation.