A+: Network Command-Line Tools

Windows contains several command-line tools for troubleshooting and configuring the network. These include the following:

    • Net— Displays and uses network resources
    • Ping— Tests TCP/IP and Internet connections
    • Tracert— Traces the route between a specified website or IP address and your PC
    • NSLookup— Displays detailed information about DNS
    • IPConfig— Displays detailed TCP/IP configuration about your Windows NT/2000/XP system

Using the Net Command

Windows includes the Net command for use in displaying and using network resources from the command line. Some of the Net commands you can use include

    • Net Help—Displays help for a Net option; for example, use Net Help View for help with the Net View command.

    • Net Use—Maps a network drive to a shared resource on the network; for example, Net Use Q: \\Tiger1\shared. In this example, Q: will behave just like any other drive letter such as C:, D:, and so on. The only difference is that it will redirect to another computer on the network.

    • Net View—Displays other hosts on the network.

    • Net Helpmsg errorcode#—Displays the meaning of any Microsoft error code.

To display a complete list of Net commands, type Net /? |More from the command prompt.

Using Ping

Windows can use the Ping command to test TCP/IP, check for connectivity to other hosts on the network, and check the Internet connection for proper operation. Ping is a more reliable way to check an Internet connection than opening your browser, because a misconfigured browser could cause you to think that your TCP/IP configuration is incorrect.

To use Ping to check connectivity with another host on the network, follow this procedure:

    A. Open a command-prompt window.

    B. Type Ping IP address or Ping servername in order to ping another host on the network, then press Enter. For example, to ping a router, typical syntax would be Ping 192.168.1.1.

To use Ping to check your Internet connection, follow this procedure:

    A. Start your Internet connection. If you use a LAN to connect to the Internet, you might have an always-on connection.

    B. Open a command-prompt window.

    C. Type Ping IP address or Ping servername and press Enter. For example, to ping a web server called www.erewhon.net, type Ping www.erewhon.net  .

By default, Ping sends four data packets from your computer to any IP address or servername you specify. If your TCP/IP connection is working properly, you should see a reply from each ping you sent out indicating how quickly the signals traveled back from the target and the IP address or URL of the target. The replies indicate that the host is alive. Any other message would indicate a problem, for example the “Request timed out” or “Destination host unreachable” messages would require further troubleshooting. Keep in mind that if it’s the local computer that is configured incorrectly, you might not be able to “ping” anything! Also watch for the amount of time the ping took to reply back. A longer latency time could indicate network congestion. Conversely, the lower the time in milliseconds (ms), the faster your connection. Connection speeds vary a great deal due to various factors, such as Internet network congestion, server speed, and the number of relays needed to transfer your request from your computer to the specified server. To check relay information, use the Tracert command.

Using Tracert

The Tracert command is used by Windows to trace the route taken by data traveling from your computer to an IP address or website you specify. By default, Tracert will check up to 30 hops between your computer and the specified website or IP address. To use Tracert to check the routing, follow this procedure:

    A. Start your Internet connection. If you use a LAN to connect to the Internet, you might have an always-on connection.

    B. Open a command-prompt window.

    C. Type Tracert IP address or Tracert servername and press Enter. For example, to trace the route to a Web server called www.erewhon.tv, type Tracert www.erewhon.tv. Tracert displays the IP addresses and URLs of each server used to relay the information to the specified location, as well as the time required.

To see help for the Tracert command, type Tracert without any options and press the Enter key.

Using NSLookup

NSLookup is a command-line tool used to determine information about the DNS. When NSLookup is run without options, it displays the name and IP address of the default DNS server before displaying a DNS prompt. Enter the name of a website or server to determine its IP address; enter the IP address of a website or server to determine its name. Enter a question mark (?) at the prompt to see more options; type exit, and then press Enter to exit the program.

Using Ipconfig

If you’re having problems seeing other computers on the network or connecting to the Internet on a network that uses server-assigned IP addresses, type IPConfig /release and press Enter; and then type IPConfig /renew and press Enter to obtain a new IP address from the DHCP server on your network.

The IPConfig command-line utility is used to display the computer’s current IP address, subnet mask, and default gateway. Ipconfig combined with the /all switch will show more information including the DNS server address and MAC address, which is the hexadecimal address that is burned into the ROM of the network adapter.

Comments