There are several alternatives for client-side DNS programming.
The most common application is to simply call the standard library
routines
gethostbyname()
or getnameinfo()
in a C or C++ program, or their equivalents provided by other programming
language libraries.
When the functionality provided by
gethostbyname()
or getnameinfo()
is not sufficient, a common approach is to reuse code from one of the
freely distributable pieces of software (such as BIND), as long as the
copyright terms are suitable. Several DNS servers are open source,
and their code is often used as a basis by programmers. For these
(including BIND and djbdns) please see the listing
of DNS server software.
In a Windows environment, reportedly the DnsQuery()
API is
quite functional, including support for SRV records from Windows 2000
onwards. Please consult the vendor documentation for more information.