Chapter 12. Interfacing DNS in Programs


Using DNS and Name lookups is really a network programming topic. However, even though this is not a network programming book, I will scratch the surface in this chapter to provide a starting point from which you can further pursue this.

Different programming languages have different interfaces for resolving hostnames. On UNIX, most have at least a binding to the standard UNIX resolver, which is usually contained in libc. As described in Chapter 2, "DNS in Practice," the UNIX resolver can use multiple services to attempt hostname resolution. Therefore, because it's not strictly using DNS, it is not DNS resolving. In most cases, though, this is still what you want, and the API will work even without the presence of DNS.

Of course, you can write software that uses the DNS protocol described in RFC 1035 directly. The protocol, however, can take up a good amount of time, and for most applications this would be a waste of the programmer's time. In most cases, using the standard resolver API, or some other API provided by your OS or language, is a better solution.



The Concise Guide to DNS and BIND
The Concise Guide to DNS and BIND
ISBN: 0789722739
EAN: 2147483647
Year: 1999
Pages: 183

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net