TCP/IP Troubleshooting |
If the problem is not NetBIOS but Sockets, the problem is related to either a Hosts file or a DNS configuration error. To determine why only IP addresses but not host names work for connections to remote computers, make sure that the appropriate Hosts file and DNS setup have been configured for the computer.
To check host name resolution configuration
Note that this procedure does not take DHCP clients into account; these clients do not have DNS server in the list.
If you are having trouble connecting to a remote system using a host name and are using a Hosts file for name resolution, the problem may be with the contents of that file. Make sure the name of the remote computer is spelled correctly in the Hosts file and by the application using it.
The Hosts file or a DNS server is used to resolve host names to IP addresses whenever you use TCP/IP utilities such as Ping. You can find the Hosts file in \
This file is not dynamic; all entries are made manually. The file format is the following:
IP Address Friendly Name
172.16.48.10 testpc1 # Remarks are denoted with a #.
The IP address and friendly host name are always separated by one or more space or tab characters.
A computer using its Hosts file for name resolution performs the following steps.
The following Hosts file problems can cause networking errors:
If you are using DNS, be sure that the IP addresses of the DNS servers are correct and in the proper order. Use Ping with the remote computer's host name and then with its IP address to determine whether the host address is being resolved properly. If the host name ping fails and the IP address ping succeeds, the problem is with name resolution. You can test whether the DNS servers are running by pinging their IP addresses or by opening a Telnet session to port 53 on the DNS server. If the connection is established successfully, the DNS service is working on the DNS server. Once you've verified that the DNS service is running, you can perform NSLookup queries to the DNS server to further verify the status of the records you are looking for.
If ping by IP address and by name fail, the problem is with network connectivity, such basic connectivity or routing. For more information about troubleshooting network connectivity, see "Troubleshooting IP Routing" later in this chapter.
A brief summary of how DNS resolves host names is provided in this section. For more information about DNS, see "Windows 2000 DNS" in this book.
DNS is a distributed database that maps domain names to data. A user can query DNS using hierarchical, friendly names to locate computers and other resources on an IP network. This allows it to largely replace the function once performed by the Hosts file. To do so, it resolves friendly names to IP addresses as follows (in the worst-case scenario, an answer might be provided by any server along the line, preventing the need for further iterative queries):
Note that this example is specific to the Internet. For more information about DNS host name resolution, recursive queries, and iterative queries, see "Introduction to DNS" in this book.
Errors in name resolution can occur if the entries in a DNS server or client are not configured correctly, if the DNS server is not running, or if there is a problem with network connectivity. To determine the cause of any name resolution problem, you can use the Nslookup utility.
Failed queries will return a variety of messages, depending on the nature of the failure. For example, if the server cannot resolve the name, it returns a message in the following format:
C:\nslookup <Destination_host>
Server: <fully_qualified_domain_name>
Address: <server_IP_address>
*** <fully_qualified_domain_name> can't find <Destination_host>: Non-existent domain
In other cases, the requests to the DNS service time out without a reply and returns a message in the following format:
C:\nslookup Valid_Host
Server: [IP_Address]
Address: w.x.y.z
DNS request timed out.
timeout was 2 seconds.
If the server fails to answer the request, Nslookup returns an error message in the following format:
C:\nslookup
*** Can't find server name for address <IP_Address>: No response from server
*** Default servers are not available.
This message indicates that the DNS server cannot be reached; it does not indicate why the server is unavailable. The server might be offline, the host computer might not have the DNS service enabled, or there might be a hardware or routing problem.
For more information about DNS troubleshooting, see "Introduction to DNS" in this book.
The name resolution problem might be in your LMHOSTS file, which looks for addresses sequentially from the top down. If more than one address is listed for the same host name, TCP/IP returns the first value it encounters, whether that value is accurate or not.
You can find the LMHOSTS file in \
Note
While \
To determine the cause of long connect times after adding an entry to LMHOSTS, take a look at the order of the entries in the LMHOSTS file.
Long connect times can occur when a large LMHOSTS file has the specified entry at the end of the file. To speed up resolution of the entry, mark the entry in LMHOSTS as a preloaded entry by following the mapping with the #PRE tag (see "Nbtstat" earlier in this chapter for an example). Then use the nbtstat -R command to update the local name cache immediately.
Alternately, you can place the mapping higher in the LMHOSTS file. As discussed in the appendix "LMHOSTS File" in this book, the LMHOSTS file is parsed sequentially from the top to locate entries without the #PRE keyword. Therefore, you should always place frequently used entries near the top of the file and place the #PRE entries near the bottom.
Make sure your computer's WINS configuration is correct. In particular, check the address for the WINS server.
To examine your WINS configuration
In the WINS Configuration dialog box, add the server's IP address (if none is listed) and check to see whether LMHOSTS lookup is enabled. Also check to see whether NetBIOS over TCP/IP is taken from the DHCP server, enabled, or disabled. If you are using DHCP for this host computer, take the value from the DHCP server. Otherwise, enable NetBIOS over TCP/IP.