Quik-Reference guide for command-line IP address utilities.
IP Address Commands For Windows
The following IP address commands can be run from the Windows command prompt. The commands listed on this page are compatible with the following versions of the Windows operating system:
- Windows XP
- Windows Vista
- Windows 7
- Windows 8
- Windows 8.1
ipconfig, an alternative to the deprecated ‘winipcfg’ utility, is a command-line utility that is available on all current versions of Microsoft Windows. There are several options that can be used with ipconfig or the command can be run by itself. To run the ipconfig command, use the following format to enter the command in the prompt:
Replace [option] with a command from the table below to get the corresponding output.
|/?||View all available options for ipconfig.|
|/all||Displays all information for each installed network adapter. Also displays DNS and WINS settings that are active for each network adapter.|
|/release||Closes all active TCP/IP connections for every installed network adapter. Also releases those IP addresses so that they are available by other programs. Only works for dynamic DHCP.|
|/renew||Closes and re-establishes all active TCP/IP connections for every installed network adapter.|
|/showclassid||Displays the DHCP classes associated with the host.|
|/setclassid||Sets the DHCP classes associated with the host.|
|/displaydns||Print the contents of the DNS cache to the command prompt.|
|/flushdns||Deletes the contents of the DNS cache.|
|/registerdns||Updates the local DNS cache for changes.|
nslookup is a IP address command and Windows command-line utility for testing and troubleshooting DNS servers.There are several options that can be used with nslookup or the command can be run by itself. To run the nslookup command, use the following format to enter the command in the prompt:
[View the Microsoft Windows documentation on nslookup.]
nslookup [-option] [hostname] [server]
Replace [option] with a command from the table below, [hostname] with a hostname, and [server] with a server address to get the corresponding output. Alternatively, you can type the command nslookup, which will enter you into the utility itself. Once you enter the utility, you can input options without the “nslookup” portion of the command. The hostname and server are optional and the Windows defaults will be used if omitted.
|NAME||print info about the host/domain NAME using default server.|
|NAME1 NAME2||as above, but use NAME2 as server.|
|help or ?||print info on common commands.|
|set OPTION||set an option. View Microsoft Windows documentation on nslookup for a list of option parameters.|
|server NAME||set default server to NAME, using current default server.|
|lserver NAME||set default server to NAME, using initial server.|
|finger [USER]||finger the optional NAME at the current default host.|
|root||set current default server to the root.|
|ls [opt] DOMAIN [FILE]||list addresses in DOMAIN (optional: output to
|view FILE||sort an ‘ls’ output file and view it with pg.|
control is a Windows command that allows a user to open a Control Panel applet directly from the Windows command prompt. Using the control command, a user can execute and windows control panel program. However, the only utility we are interested in is the network connections utility. To run the network connections utility from the command prompt, use the following format to enter the command in the prompt:
Ping is a Windows network utility used to troubleshoot issues with computer networks. The use of the ping command sends a ICMP packet to the IP address specified and displays data about the request and response. To run the ping command, use the following format to enter the command in the prompt:
ping [option] [option value] [IP address]
The options from the table below can be used with the ping command to customize the output and functionality of the ICMP packets.
|-n||The number of ICMP requests to send. The default is 4.|
|-w||Define a custom timeout (in milliseconds) for the ping requests. The default is 1000 milliseconds|
|-l||Define a custom size for the packets. The default packet size is 32 bytes.|
|-f||Sets the Do Not Fragment bit on the ping packet. By default, the ping packet allows fragmentation.|
The tracert command is also know as trace route. Tracert simply sends a series of ICMP packets to some IP address. Each of the subsequent packets uses increasing TTL values. The output contains information related to each intermediary point between the source of the requests and the destination. To run the tracert command, use the following format to enter the command in the prompt:
tracert [option] [option value] ... [IP address]
The options from the table below can be used with the tracert command to customize its output and functionality. Multiple options and values may be used, however, the “-d” option is the only one used in a standalone manner.
|-d||This option requires no additional value. Omit resolution intermediate router IP addresses. This option sometimes increases the speed of the trace.|
|-h||The maximum number of hops until the destination is reached. The default is 30 hops.|
|-j||Uses the Loose Source Route option in the IP header with the set of intermediate destinations specified in HostList. With loose source routing, successive intermediate destinations can be separated by one or multiple routers. The maximum number of addresses or names in the host list is 9. The HostList is a series of IP addresses (in dotted decimal notation) separated by spaces.|
|-w||The amount of time (in milliseconds) to wait for a response. The default is 4000 milliseconds.|
The netstat command is a Windows command-line utility that displays information active TCP connections and Ports. To run the netstat command, use the following format to enter the command in the prompt:
netstat [option] [option value] ...
The options from the table below can be used with the netstat command to customize its output and functionality. Multiple options and values as well as no options may be used.
|-a||Displays all active TCP connections and the TCP and UDP ports on which the computer is listening.|
|-e||Displays Ethernet statistics, such as the number of bytes and packets sent and received. This parameter can be combined with -s.|
|-n||Displays active TCP connections, however, addresses and port numbers are expressed numerically and no attempt is made to determine names.|
|-o||Displays active TCP connections and includes the process ID (PID) for each connection. You can find the application based on the PID on the Processes tab in Windows Task Manager. This parameter can be combined with -a, -n, and -p.|
|-p||Shows connections for the protocol specified by Protocol. In this case, the Protocol can be tcp, udp, tcpv6, or udpv6. If this parameter is used with -s to display statistics by protocol, Protocol can be tcp, udp, icmp, ip, tcpv6, udpv6, icmpv6, or ipv6.|
|-s||Displays statistics by protocol. By default, statistics are shown for the TCP, UDP, ICMP, and IP protocols. If the IPv6 protocol for Windows XP is installed, statistics are shown for the TCP over IPv6, UDP over IPv6, ICMPv6, and IPv6 protocols. The -p parameter can be used to specify a set of protocols.|
|-r||Displays the contents of the IP routing table. This is equivalent to the route print command.|
Route is a Windows command-line tool that allows users to display and modify entries located in the local IP routing table. This command has several options that can be used together that are much more complex that the other commands listed on this page. For more information on the route command-line utility, visit the Windows Website on Route.
The arp command is a network utility that allows users to display and modify entries in the Address Resolution Protocol (ARP) cache. Several options can be used that allow users to modify local ARP cache resources that can be viewed on the Microsoft website. However, if you merely want to view all of the information in the local ARP cache, just type the following into the command prompt: