Resolving Remote Addresses

The process of turning a name like www.lwn.net into an IP number is quite complex. It involves a number of files in your local system's /etc directory, including files such as /etc/resolv.conf, /etc/hosts, and /etc/nsswitch.conf, to name a few of them. Depending upon how your local system is configured, other files and daemon processes might come into play as well. For example, after these files have

OUTPUT

OUTPUT

been consulted, a name server can be queried, which itself can forward queries to other name servers. All of this complexity represents detail that you really don't want to think about when writing your application program.

Fortunately, the application writer is able to play the part of an ostrich and stick his head in the sand. If the system is properly configured, a few system function calls will be all that is required on the part of the programmer. Covered next is a related set of functions, which hide this complexity of remote name lookups for you.

NOTE:

It will be assumed in this book that you have a Linux system that is properly configured. Entire books have been written on system and network administration. Consequently, the focus of this book is to teach you how to program with sockets, and not how to set up domains and name servers.

Copyright © Macmillan Computer Publishing, Inc.

Was this article helpful?

0 0

Post a comment