The Domain Name System (DNS) maps host names to numeric IP addresses, and is crucial for the function of any Internet-connected computer, especially with Microsoft’s introduction of the Active Directory service, which uses Internet standard protocols like TCP/IP.
A full introduction to and description of the DNS is outside the scope of this article, but if you wish to learn more, http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnduwon/html/d5dns.asp is a good start, along with other Microsoft Developer Network (MSDN) articles on DNS.
Words of warning
Please note that you cannot make up random DNS entries and/or IP addresses on systems connected to the Internet. If you want to take part in the global DNS, you must apply to register names with a Domain Registrar, and have your ISP allocate an IP address (or more) for your computer(s). Also note that in many cases (such as when you use a dial-up connection), your ISP’s Dynamic Host Configuration Protocol (DHCP) server will assign your computer an IP address, hostname and gateway via the dial-up networking interface, so be careful about how you manipulate these settings, or you might lose your Internet connection.
DNS in Windows XP Professional is managed in several places. To start with, you can give your computer a Fully-Qualified Domain Name (FQDN) in the form of host-name.domain-name — for instance, juhaspc.idg.com.au — by clicking on Control Panel-System and the Computer Name tab in the dialogue box that pops up. The Change button displays another dialogue for Computer Name Changes, and if you click the More… button, you’ll get a third dialogue that allows you to enter the Primary DNS suffix for your computer. This is the domain name — in my case, idg.com.au — that gets appended to the computer (or host) name, i.e., juhaspc.
If your computer is a member of Windows domains, you can have it automatically change the domain name part in the FQDN, by ticking the “Change primary DNS suffix when domain membership changes” box. Changing the computer name will not take effect until after a system reboot. The name itself (host and domain) cannot be longer than 255 bytes or characters — dashes are fine, but not underscores, forward and backward strokes, or extended-ASCII characters.
If you look at the TCP/IP properties of your network interface (open up My Network Places, and select View-Network Connections, select for example the Local Area Connection and click Change Settings for this connection in the Network Task pane to your right, then select TCP/IP and click Properties), you’ll find more DNS settings. Click the Advanced button, and the DNS tab in the dialogue that pops up.
Here, you can add DNS servers that your computer can query for address lookups. Windows only allows IP addresses for the DNS servers, and not FQDNs, unlike UNIX TCP/IP stacks which can use both forms. If you have a DNS server running on your LAN, add it here, or if you forward all requests to your ISP’s DNS server, add that. You’ll need permission to query someone else’s DNS server.
You can also control how unqualified names (like ‘juhaspc’) are resolved, by telling the Windows XP resolver to search domain suffixes (e.g., idg.com.au), and in which order to go through them — if you know your network topology, entering the DNS suffixes in the right order could speed lookups. For systems with static IP addresses (that is, not configured by DHCP), you can add the domain name in an entry box at the bottom half of the dialogue.
Also at the bottom of the dialogue is the “Register this connection’s addresses in DNS” option. Unless the network you are connected to runs a DNS server that allows for Dynamic Updates, I suggest you leave this box cleared. Dynamic DNS Updates are generally not used for normal Internet connections, and thus only create unnecessary traffic for you.
Cache and client
Windows XP Professional also comes with a DNS Client service. This is essentially a small program that caches DNS lookups and Active Directory names for faster lookups — when your program tries to resolve a DNS name to an IP address, it won’t have to wait for a reply from a DNS server that can be far away on the Internet, if the answer to the query is already stored in the cache on your local computer.
The DNS Client service is set to run automatically each time the computer starts up, and is necessary if you connect to an Active Directory server, or if you use IPsec for network connections. It’s not necessary if you have a DNS server on your network, and you can stop it via Control Panel-Administrative Tools-Services as Administrator.
To clear your computer’s local DNS cache (in case it’s storing a wrong answer, for instance), fire up a CMD prompt (Start-Run-CMD) and type:
The /displaydns switch shows you what’s currently stored in the local resolver cache, which can be useful for troubleshooting.