Platform SDK: Network Management

Domain Name System

Domain Name System, DNS, is an industry-standard protocol used to locate computers on an IP-based network. Users are better at remembering friendly names, such as www.microsoft.com or msdn.Microsoft.com, than number-based addresses, such as 207.46.131.137.

IP networks, such as the Internet and Microsoft® Windows 2000 networks, rely on number-based addresses to ferry information throughout the network; therefore, it is necessary to translate user-friendly names (www.microsoft.com) into addresses that the network can recognize (207.46.131.137). DNS is the service of choice in Windows 2000 to locate such resources and translate them into IP addresses.

DNS is the primary locator service for Active Directory, and therefore, DNS can be considered a base service for both Windows 2000 and Active Directory. Windows 2000 provides functions that enable application programmers to use DNS; functions such as programmatically making DNS queries, comparing records, and looking up names.

Many DNS functions are actually function types, in that there is a base name for the function, but its use depends on character encoding. For example, the DnsQuery function is listed in the function reference of the DNS Application Programmer's Interface (API) as DnsQuery, but its use in applications depends on whether the character encoding is ANSI (designated by appending _A to the function type name), Unicode (designated by appending _W to the function type name), or UTF-8 (designated by appending _UTF to the function type name). Therefore, the function call for the DnsQuery function would actually be one of the following:

DnsQuery_A (_A for ANSI encoding)

DnsQuery_W (_W for Unicode encoding)

DnsQuery_UTF8 (_UTF8 for UTF-8 encoding)

All functions that require this convention clearly state this requirement within the first few sentences of their function definition. You must use the proper function name; for example, you cannot simply call DnsQuery instead of DnsQuery_A.