Host Name Resolution Using a DNS Server for IPv4
A version of this page is also available for
4/8/2010
To make host name resolution scaleable and centrally manageable, IP address mappings for fully-qualified domain names (FQDNs) are stored on DNS servers. Windows Embedded CE does not support hosting a DNS server running on Windows Embedded CE. However, Windows Embedded CE queries a DNS server for name resolution if a server exists on the network.
The following process outlines what happens when the DNS resolver on a host sends a DNS query to a DNS server.
- The DNS resolver formats a DNS Name Query containing the FQDN and sends it to the configured DNS server. The DNS domain name will then be appended to the name to be resolved. If the system has multiple network adapters, multiple DNS domain names can be used and the resolver queries each network adapter. The adapter specific DNS domain name is stored in the Domain value in the HKEY_LOCAL_MACHINE\Comm\<Adapter Name>\Parms\Tcpip registry key.
- The DNS server checks the FQDN in the DNS Name Query against locally-stored address records. If a record is found, the IP address corresponding to the requested FQDN is sent back to the client.
- If the FQDN is not found, the DNS server forwards the request to a DNS server that is authoritative for the FQDN.
- The authoritative DNS server returns the reply, containing the resolved IP address, back to the original DNS server.
The original DNS server sends the IP address mapping information to the client.
Windows Sockets applications generally use the gethostbyname or getaddrinfo functions to resolve a host name to an IP address. When looking up a name, the resolver performs the following operations by default:
Checks the registry for a name that matches the value of the HKEY_LOCAL_MACHINE\Comm\Tcpip\Hosts\host name entry.
Checks the name cache, which is stored in memory for Windows CE 3.0 and later, unless HKEY_LOCAL_MACHINE\Comm\Afd\ResolverCheckCacheFirst is equal to zero.
If a DNS Server is configured and the name matches the definition of a DNS name, the resolver queries the DNS server as outlined above. The resolver tries both the primary DNS Name Server (DNS1) and the secondary DNS Name Server (DNS2).
If the resolver does not find a match and the name matches the definition of a WINS name, the resolver tries the NetBIOS Name Server. The resolver tries both the primary NetBIOS Name Server (WINS1) and the secondary NETBIOS Name Server (WINS2).Tries the IP subnet broadcast, if the resolver did not find a match in the earlier steps.
Tries the name cache, if the resolver did not find a match in the earlier steps and if the ResolverCheckCacheFirst registry entry is equal to 0.
Note
The resolver determines whether the name that you want to look up matches the definition of a DNS name or the definition of a WINS name. The resolver then queries only the appropriate servers, based on the type of name matched.
Some applications use the resolver to resolve an IP address to a host name. The resolver performs the following operations by default:
Checks the registry for a matching name entry
Queries a Domain Name Server, if one is configured
Sends a NetBIOS unicast message to the device, if the resolver did not find a match in the earlier steps
Note
For information about host name registration, see Name Registration for IPv4.
Note
Windows XP support for host name resolution using a DNS server is slightly different. For more information about host name resolution on Windows XP, see the Windows XP documentation.
For information about host name resolution for IPv6, see Host Name Resolution for Dual Stack (IPv4/IPv6).