Configuring the local host table (optional)

You can set up the local host table to support local host name resolution. If you use the local host table for this purpose, your socket applications will be able to resolve only names and IP addresses that appear in your local host table.

If you need to resolve host names outside your local area, you can configure the resolver to use a domain name server (see the NSINTERADDR statement). If you use a domain name server, you do not need to set up any host definitions in your resolver configuration, but you may still do so.

If you have configured your resolver to use a name server, it will always try to do so, unless your TCP/IP C/C++ API applications were written with a RESOLVE_VIA_LOOKUP symbol in the source code. You can also configure the resolver to use only a local host table by specifying LOOKUP LOCAL in the TCPIP.DATA configuration file. For both cases, all name resolution calls will always use a local host table. This is probably not a technique you will see for standard socket applications, but it may be a technique you could find useful for when you develop your own socket applications or for testing changes before they are placed in your name server.

It might be a good idea to have a local host table available for the resolver to use if the name server is not reachable. If the name server does not respond to name resolution requests, the resolver tries to use the local host table. If the name server is reachable but returns a negative reply for a name resolution request, the resolver tries to resolve the name using the local host table, if such a file is present.

Assume you try to resolve the host name friendly and your DOMAINORIGIN is my.house.com, the resolver sends a query to the name server for friendly.my.house.com. If the name server returns a negative reply (the name is not registered), the resolver looks into the local host table for an entry of friendly.my.house.com and, if not found, for an entry of friendly.

Due to the flexibility of the Domain Name System, it is recommended you use a domain name server. If you set up a small IP network, the simplicity of the local host table approach might be preferable.

The following types of local host table can be used: