The ipconfig (short for IP Configuration) is a basic, yet popular, Windows network command-line utility used to display the TCP/IP network configuration of a computer. If you are familiar with Linux, this tool is similiar to ifconfig. This tool is often used for troubleshooting network connectivity issues. With ipconfig, you can identify the types of network adapaters on your computer, the computer’s IP address, the IP addresses of the DNS (Domain Name System) servers being used, and much more.
These commands shown here are tested on a comptuer with Windows 10 but most will work in other versions of Windows as well.
Table of Content
- Overview
- How to Launch Command Prompt
- Ipconfig Syntax
- Ipconfig Parameters
- Example Usage
- ipconfig — Retrieves Basic TCP/IP Network Information (IP, subnet mask, gateway)
- ipconfig /all — Retrieves All TCP/IP Network Information (MAC address, adapter description, DHCP details)
- ipconfig /release — Releases the IPv4 Address of All Network Adapters
- ipconfig /release6 — Releases the IPv6 Address of All Network Adapters
- ipconfig /release <adapter> — Releases the IP Address of a Specific Network Adapter
- ipconfig /renew — Get a New IPv4 Address for All Network Adapters
- ipconfig /renew6 — Get a New IPv6 Address for All Network Adapters
- ipconfig /renew <adapter> — Get a New IPv4 Address for a Specific Network Adapter
- ipconfig /displaydns — View DNS Cache
- ipconfig /flushdns — Purge DNS Cache
- ipconfig /all | findstr /v 00-00-00 | findstr Physical — Display MAC Address of Only Physical Connected Network Adapters
- Other Usages and Getting Help
- Tips
- Redirect Output to Text File
- Recommended Reading
- Summary
Overview
The ipconfig is a Windows command-line utility used often to troubleshooting computer network issues. If you are a Linux user, this utility is similar to ifconfig. This is often used to determine the local IP address, subnet mask, the gateway address, and other network configuration of a computer. Additionally, this tool is used to refresh DHCP (Dynamic Host Configuration Protocol) and DNS (Domain Name System) settings
While most of the information provided by the ipconfig command-line utility can be found via a more user-friendly graphical interface, sometimes that interface may not be available and command prompt is your only available option. If you are a help desk technician or a network professional, it is recommended that you understand the command-line method of retrieving a computer’s network configuration, and it some cases, performing network functions.
How to Open Command Prompt
To use this utility, you will need to launch the Command Prompt window. The three common ways to launch the Command Prompt window are:
- Search for
cmd
using the built-in Windows search tool. - Right-click on the Start icon and select Command Prompt.
- Press the keyboard combination WinKey + R, then type
cmd
at the Run window that appears.
Ipconfig Syntax
ipconfig [/allcompartments] [/all] [/renew [<Adapter>]] [/release [<Adapter>]] [/renew6[<Adapter>]] [/release6 [<Adapter>]] [/flushdns] [/displaydns] [/registerdns] [/showclassid <Adapter>] [/setclassid <Adapter> [<ClassID>]]>
Ipconfig Parameters
Parameter | Description |
---|---|
/all | Display the full TCP/IP configuration information for all network adapters. |
/release | Release the IPv4 address for the specified adapter. |
/release6 | Release the IPv6 address for the specified adapter. |
/renew | Renew the IPv4 address for the specified adapter. |
/renew6 | Renew the IPv6 address for the specified adapter. |
/flushdns | Purges the DNS Resolver cache. |
/registerdns | Refreshes all DHCP leases and re-registers DNS names. |
/displaydns | Display the contents of the DNS Resolver Cache. |
/showclassid | Displays all the DHCP class IDs allowed for adapter. |
/setclassid | Modifies the DHCP class ID. |
/showclassid6 | Displays all the IPv6 DHCP class IDs allowed for adapter. |
/setclassid6 | Modifies the IPv6 DHCP class ID. |
/? | Displays help information. |
Example Usage
There are a variety of switches (sub commands) available with the ipconfig utility that will either display certain information or perform certain network functions. At the most basic, the ipconfig displays a computer’s IP address, subnet mask and the default gateway (which is typically the IP address of your router or network firewall).
ipconfig — Retrieve Basic TCP/IP Network Information
To get basic network information from your computer, type the following in the command window then press Enter: ipconfig
The screenshot example below is the ipconfig output of a particular computer. The output of your ipconfig result will differ depending on your network setup and the type of network adapters installed on your computer. In our screenshot example, it shows the following basic networking information about the computer from which ipconfig was ran.
- IPv4 address: 192.168.0.98
- Network subnet mask: 255.255.255.0
- Default Gateway: 192.168.0.1
Please note that unless your computer is connected directly to the Internet (this is rare), the IP address reported by ipconfig will be your local network IP, not your public external IP address.
While other network details can be retrieved by the ipconfig utility, for most network troubleshooting, this is what is typically needed.
ipconfig /all — Retrieve All TCP/IP Network Information
Another useful switch with ipconfig is to have it report all TCP/IP network details for all network adapters on a computer. This is accomplished by using the /all
switch. This switch provides you with the same basic information as ipconfig described above, but with a lot more detail. To retrieve all network information about your computer, type the following in the command window then press Enter: ipconfig /all
This will show a detailed report of various network details for the computer. Again, your report will differ depending on your network setup and the network adapters installed on your computer. This report includes information such as:
- Make and model of your network adapter(s)
- Physical address (also known as the MAC address or hardware address) of your adapter(s)
- Whether your IP address is leased (i.e., DHCP issued or statically assigned)
- If IP address is leased, what the lease expiration and the DHCP that leased it
- DNS servers
As you can see, ipconfig /all
provides you with a plethora of details about your computer network setup.
ipconfig /release — Releases the IPv4 Address of All Network Adapters
The /release
switch will cause ipconfig to go through the network adapters you have and drop the dynamically issued IPv4 address by sending a DHCPRELEASE message to the DHCP server. For the majority of the time, you would follow this command with ipconfig /renew
(described below) will cause your network adapters to reach out to your DHCP server for an IP address (it can be a new IP address or the same IP you had prior to when you performed the /release
command). For most, executing this command does not have adverse effect on your computer.
To release your IP address from your computer, type the following in the command window then press Enter: ipconfig /release
Note, if you have a statically assigned (manually assigned) IP address, this command will not release it. See example ipconfig /renew for related information.
ipconfig /release6 — Releases the IPv6 Address of All Network Adapters
The command is similar to ipconfig /release except it renews the IPv6 address on the adapters.
ipconfig /release <adapter> — Releases the IPv4 Address for a Specific Network Adapters
The /release <adapter>
switch will cause ipconfig to drop the dynamically issued IPv4 address by sending a DHCPRELEASE message to the DHCP server for a specific network adapter.
To release the IP address for a specific network adapter on your computer named «Local Area Connection 3», type the following in the command window then press Enter: ipconfig /release "Local Area Connection 3"
Note, if you have a statically assigned (manually assigned) IP address, this command will not release it. See example for ipconfig /renew for related information.
ipconfig /renew — Get a New IPv4 Address for All Network Adapters
The ipconfig /renew
will cause your computer to reach out to your DHCP server for an IPv4 address if it doesn’t already have one or renews an existing one for all network adapters. Depending on how your DHCP server is configured or the pool of available addresses, the IP address you will receive can be one you had previously or it can be a new IP address. Once you execute this command, it will typically take just seconds for a DHCP to assign your computer with an IP address. In the illustration below, the IP address assigned to this computer is 192.168.226.132.
To renew the IP address of your computer, type the following in the command window then press Enter: ipconfig /renew
See example for ipconfig /release for related information.
ipconfig /renew6 — Get a New IPv6 Address for All Network Adapters
The command is similar to ipconfig /renew except it renews the IPv6 address on the adapters.
ipconfig /renew <adapter> — Get a New IPv4 Address For a Specific Network Adapter
The ipconfig /renew <adapter>
will cause your computer to reach out to your DHCP server for an IPv4 address if it doesn’t already have one or renews an existing one for a specific network adapter. Depending on how your DHCP server is configured or the pool of available addresses, the IP address you will receive can be one you had previously or it can be a new IP address. Once you execute this command, it will typically take just seconds for a DHCP to assign your computer with an IP address. In the illustration below, the IP address assigned to the network adapter named «Local Area Connection 3» is 192.168.226.132.
To renew the IP address for a network adapter on your computer named «Local Area Connection 3», type the following in the command window then press Enter: ipconfig /renew "Local Area Connection 3"
. To find out the name(s) of the network adapters on your computer, type the following in the command window then press Enter: ipconfig
See example for ipconfig /release for related information.
ipconfig /all | findstr /v 00-00-00 | findstr Physical
— Display MAC Address of Only Physical Connected Network Adapters
The ipconfig utility, with the /all
switch, is often used to find the MAC address (the 6-byte ‘burned-in’ physical/hardware address) of network adapters. While this does the job, the output shows a plethora of information as mentioned above. If you have multiple adapters, the output can be lengthy making it cumbersome to find what you are looking for.
The Windows findstr utility is used to search for patterns of text. By feeding the output of ipconfig /all
into findstr
, we can significantly reduce the clutter and have the output show only the MAC address of physical network adapters. To accomplish this, type the following in the command window then press Enter:
ipconfig /all | findstr /v 00-00-00 | findstr Physical
This command is actually a series of three commands, namely:
ipconfig /all
findstr /v 00-00-00
findstr Physical
The vertical bar (|), more commonly referred to as the pipe, is a ‘command’ that takes the output from the left side of the pipe and feeds it as input to the command on the right, bypassing the computer screen.
As the above command shows, the output of ipconfig /all
is funneled into the command findstr /v 00-00-00
as its input. The findstr
with the /v
switch will look for lines of text in the output of ipconfig /all
that does not contain 00-00-00. What this does is exclude any network adapters that are disabled or not connected. These network adapters will have MAC address that starts with 00-00-00.
The result from the first findstr will still contain a lot of information that we can further filter out, such as DHCP lease information. To further reduce clutter to ultimately end up with an output that lists only MAC address of physical adapters, we will need to funneled the output of the first findstr into a second findstr command. This second findster will filter out every line of text except those that has the word Physical.
This series of commands produce an output that is concise to show only the MAC address of connected network adapters. As the illustration below shows, this is a much more easier report to read as oppose to using just using ipconfig /all
.
ipconfig /displaydns — View DNS Cache
When you visit a website using it’s domain name (e.g., www.meridianoutpost.com), your computer will need to know the IP address for that website in order for it to find it the server hosting it on the Internet. The process of identifying the IP address is called DNS lookup (analogous to looking up a number in a phone book). Once your computer learns the associated IP address for the website you want to visit, it will cache it (store it) on your computer. The purpose of caching it is to improve performance by not having your computer perform a DNS lookup each time you access a web page on the website.
This command will list all the currently cached IP addresses on your computer (also referred to as the DNS resolver cache). If you’ve accessed a lot of websites since turning on your computer, this list can be very lengthy. The illustration below shows just a few entries out of many for a particular computer. If you just turned on our computer and have not access websites or servers on the network on the Internet, then you list will only show a «localhost» setting in your local hosts file.
To display cached DNS entries on your computer, type the following in the command window then press Enter: ipconfig /displaydns
This command is typically used to troubleshoot specific DNS lookup issues. See example for ipconfig /flushdns for related information.
The information displayed on the list include:
- Record Name: the name of the website or server that a DNS lookup was performed on
- Record Type:
- 1 = A
- 2 = NS (indicates the entry is a name server)
- 5 = CNAME (stands for canonical name and is a type of record that maps an alias name to a true domain name)
- 15 = MX (indicates the entry is an email server)
- Time to Live: the time (in seconds) before this cache entry expires (can be as short as a few minutes to a few days)
- Data Length: the length (in bytes)
- 8 Bytes = IPv4 address
- 16 Bytes = IPv6 address
ipconfig /flushdns — Purge DNS Cache
This command will purge the cached DNS entries on your computer. You would typically do this to troubleshoot DNS related problems. An example of this is when you try to access a website but you encounter an error message stating the website is not found. For most people, executing this command does not have adverse effect on your computer. See example for ipconfig /displaydns for related information.
To delete all the cached DNS entries on your computer, type the following in the command window then press Enter: ipconfig /flushdns
Other Usages and Getting Help
The example usage described in the article shows only some of the functions available with ipconfig. To get a list of the available switches, type the following in the command window then press Enter: ipconfig /?
Tips
Redirect Output to Text File
- Instead of displaying the results on the screen, you can have the results saved automatically to a text file on your computer. To do this, simply use the «>» symbol followed by the folder path and file name of your choice. For example, to redirect the output of ipconfig /renew, type the following in the command window then press Enter:
ipconfig /renew > c:\temp\ipconfig-results.txt
This will create a file named ipconfig-results.txt in the folder path c:\temp that will have your result. You can then open this file with any text editor, such as Notepad on a Windows computer, as illustrated below.
Recommended Reading
Improve confidence and job performance
Improve productivity and efficiency
Learn more,
earn more
Life-long
investment
To learn more about this topic, we are providing you with recommendations to help you further your knowledge. These are our affiliate links to Amazon where you can purchase them and also explore a variety of other relevant books.
Summary
The ipconfig utility can provide a wealth of information for troubleshooting network issues. This utility is a valuable resource for computers that obtains an IP address automatically. If you are helpdesk technician, network administrator, or system administrator, this is a great utlity to become familiar with.
(Image credit: Future)
Windows 10 makes it easy to connect to a network and the internet using a wired or wireless connection. However, sometimes, you may still need to manually manage settings or troubleshoot connectivity problems, which is when the built-in command-line tools can come in handy.
Regardless of the issue, Windows 10 will likely have a Command Prompt tool to help you resolve the most common problems. For instance, ipconfig and ping are among the most important tools for viewing network settings and troubleshooting connectivity issues. If you are dealing with a routing problem, the route command can display the current routing table to examine and determine related problems, and with the nslookup tool, you can diagnose DNS problems.
You also have tools like arp to troubleshoot switching problems and determine the MAC address from an IP address. The netstat command-line tool allows you to view statistics for all the connections. And you can use the netsh tool to display and change many aspects of the network configuration, such as checking the current configuration, resetting settings, managing Wi-Fi and Ethernet settings, enabling or disabling the firewall, and a lot more.
This guide highlights eight Command Prompt tools that should help you manage and troubleshoot networking problems on your device and across the network.
1. IPConfig
On Windows 10, ipconfig (Internet Protocol configuration) is among the most common networking tools that allow you to query and show current TCP/IP (Transmission Control Protocol/Internet Protocol) network configuration. The command also includes options to perform different actions, such as refreshing Dynamic Host Configuration Protocol (DHCP) and Domain Name System (DNS) settings.
Display network configuration
To get started with ipconfig on Windows 10, use these steps:
All the latest news, reviews, and guides for Windows and Xbox diehards.
- Open Start.
- Search for Command Prompt, right-click the top result, and select the Run as administrator option.
- Type the following command to view a summary of the TCP/IP network configuration and press Enter: ipconfig
- Quick tip: In Command Prompt, you can use the CLS command to clear the screen after you no longer need the information to continue running commands without clutter.
- Type the following command to view the complete TCP/IP network configuration and press Enter: ipconfig /all
Once you complete the steps, you will have an overview of the PC’s entire TCP/IP configuration.
Refresh network settings
To release and renew the network configuration with Command Prompt, use these steps:
- Open Start.
- Search for Command Prompt, right-click the top result, and select the Run as administrator option.
- Type the following command to remove the current network configuration and press Enter: ipconfig /release
- Type the following command to reconfigure the network configuration and press Enter: ipconfig /renew
After you complete the steps, the first command will clear the current configuration, and the second command will fetch new settings from the DHCP server to resolve connectivity issues. If the dynamically assigned settings have not expired in the server, it is common to see the same IP address reconfigured on the device.
Refresh DNS settings
To flush and rebuild the current DNS cache entries on Windows 10, use these steps:
- Open Start.
- Search for Command Prompt, right-click the top result, and select the Run as administrator option.
- Type the following command to clear the DNS system cache on the device and press Enter: ipconfig /flushdns
Once you complete the steps, the entries stored in the DNS cache of Windows 10 will be deleted and refreshed. Usually, this command will come in handy when you cannot connect to another computer or website using the host or domain name due to outdated information in the local cache.
2. Ping
Ping is another essential networking tool because it allows you to send ICMP (Internet Control Message Protocol) echo request messages to test the IP connectivity with other devices, whether it is another computer in the network or internet service.
Test device connectivity
To test the network connectivity with the ping command on Windows 10, use these steps:
- Open Start.
- Search for Command Prompt, right-click the top result, and select the Run as administrator option.
- Type the following command to send ICMP echo requests to test connectivity and press Enter: ping IP-OR-DOMAIN
In the command, replace IP-OR-DOMAIN with the actual IP address or domain name of the computer or service you want to test. For example, this command tests the communication between the local device and router: ping 10.1.4.1
- Quick tip: If you use the -a option (for example, ping -a 10.1.4.1), the command will also resolve the address to a hostname.
- (Optional) Type the following command to test the local computer networking stack and press Enter: ping 127.0.0.1 or ping loopback
- Quick note: The 127.0.0.1 is a well-known address, and it is referred to as the loopback address. When you run the command, if you get a reply, it means that the networking stack on Windows 10 is up and running. This is the same as pinging the device using its own network address.
Once you complete the steps, receiving four successful echo replies from the destination means the device can talk with the remote host. If the request times out, there is a problem between the host and the remote device.
If you are dealing with connectivity problems, start pinning the local computer to ensure the network stack is working. Then test the router’s connection to ensure the issue is not in the local network. Then try to ping a website to find out whether there is a problem with the internet connection or the remote host.
You should also know that the ping command will always time out if the remote device or service blocks the ICMP protocol.
Diagnose packet loss activity
The ping command includes many options that you can access with the «ping /?» command, and one of these options is the ability to set the time you want to run the tool, which can come in handy to examine packets lost when you are troubleshooting connectivity problems.
To run the ping command for a specific period, use these steps:
- Open Start.
- Search for Command Prompt, right-click the top result, and select the Run as administrator option.
- Type the following command to continue pinging until stopped and press Enter: ping IP-OR-DOMAIN -t
In the command, replace IP-OR-DOMAIN with the actual IP address or domain name of the computer or service you want to test. For example, this command tests the communication between the local device and router: ping 10.1.4.1 -t
- Use the «Control + C» keyboard shortcut to stop the ping.
After you complete the steps, you will be able to see the successful and lost requests that can give you a clue on how to continue troubleshooting and resolving the connectivity problem. Administrators usually use the ping command in a local network to find out when a service goes down quickly. Also, the tool can be used as a quick way to know when the server is up and running again when restarting a server remotely.
3. Tracert
Windows 10 also includes tracert (Trace Route), a diagnostic tool to determine the network path to a destination using a series of ICMP echo requests. However, unlike the ping command, each request includes a TTL (Time to Live) value that increases by one each time, allowing to display of a list of the route the requests have taken and their duration.
To trace the route to a destination with Command Prompt on Windows 10, use these steps:
- Open Start.
- Search for Command Prompt, right-click the top result, and select the Run as administrator option.
- Type the following command to understand the path taken to the destination and press Enter: tracert IP-OR-DOMAIN
In the command, replace IP-OR-DOMAIN with the actual IP address or domain name for the destination you want to troubleshoot. For example, this command allows you to view the path the packets are taking to reach Google.com: tracert google.com
- (Optional) Type the following command to adjust the hop counts to the destination and press Enter: tracert -h HOP-COUNT IP-OR-DOMAIN
In the command, replace IP-OR-DOMAIN with the actual IP address or domain name for the destination you want to troubleshoot and HOP-COUNT for the number of hops you want to trace. For example, this command puts the limit of 5 hops (nodes) to the destination: tracert -h 5 google.com
Once you complete the steps, you will know if the destination is reachable or if there is a networking problem along the way.
Similar to the ping tool, tracert includes several options, which you can view with the «tracert /?» command.
4. NSLookup
The nslookup (Name Server Lookup) tool can show valuable details to troubleshoot and resolve DNS-related issues. The tool includes an interactive and non-interactive modes. However, you will be using the non-interactive mode more often than not, which means you will type the full command to obtain the necessary information.
You can use this command to display the default DNS name and address of the local device and determine the domain name of an IP address or the name servers for a specific node.
To get started with nslookup on Windows 10, use these steps:
- Open Start.
- Search for Command Prompt, right-click the top result, and select the Run as administrator option.
- Type the following command to look up the local DNS name and address and press Enter: nslookup
- Quick note: This command also happens to open the nslookup interactive mode.
- Confirm the current DNS information.
- Type the following command to exit the interactive mode and press Enter: exit
- Type the following command to determine the name and address of a specific server and press Enter: nslookup IP-ADDRESS
In the command, replace the IP-ADDRESS with the address of the remote device. For example, this command looks up the IP address 172.217.165.142 address: nslookup 172.217.165.142
- Type the following command to determine the address of a specific server and press Enter: nslookup DOMAIN-NAME
In the command, replace the DOMAIN-NAME with the address of the remote device. For example, this command looks up the IP address Google.com address: nslookup google.com
After you complete the steps, depending on the command, you will know whether the device has a DNS resolver and the IP address or domain and vice versa of the remote host.
5. NetStat
The netstat (Network Statistics) tool displays statistics for all network connections. It allows you to understand open and connected ports to monitor and troubleshoot networking problems for Windows 10 and apps.
When using the netstat tool, you can list active network connections and listening ports. You can view network adapter and protocol statistics. You can even display the current routing table and much more.
To get started with netstat, use these steps:
- Open Start.
- Search for Command Prompt, right-click the top result, and select the Run as administrator option.
- Type the following command to show all active TCP connections and press Enter: netstat
- (Optional) Type the following command to display active connections showing numeric IP address and port number instead of trying to determine the names and press Enter: netstat -n
- (Optional) Type the following command to refresh the information at a specific interval and press Enter: netstat -n INTERVAL
In the command, make sure to replace INTERVAL for the number (in seconds) you want to redisplay the information. This example refreshes the command in question every five seconds: netstat -n 5
- Quick note: When using the interval parameter, you can terminate the command using the «Ctrl + C» keyboard shortcut in the console.
Once you run the command, it will return a list of all active connections in four columns, including:
- Proto: Displays the connection protocol, including TCP or UDP.
- Local Address: Displays the device’s IP address followed by a semicolon with a port number of the connection. The double-semicolon inside brackets indicates the local IPv6 address. The «0.0.0.0» address also refers to the local address.
- Foreign Address: Shows the remote computer’s IP (or FQDN) address with the port number after the semicolon port name (for instance, https, http, microsoft-ds, wsd).
- State: Shows whether the connection is active (established), if the port has been closed (time_wait) and if the program has not closed the port (close_wait). Other statuses available include closed, fin_wait_1, fin_wait_2, last_ack, listen, syn_received, syn_send, and timed_wait.
6. ARP
Windows 10 maintains an arp (Address Resolution Protocol) table, which stores IP to Media Access Control (MAC) entries that the system has resolved. The arp tool lets you view the entire table, modify the entries, and use it to determine a remote computer’s MAC address.
Usually, you do not need to worry about MAC addresses, but there are scenarios when this information may come in handy. For example, when troubleshooting network problems at the data link layer (switching) or when restricting access or filtering content through the network for specific devices.
To get started with arp on Windows 10, use these steps:
- Open Start.
- Search for Command Prompt, right-click the top result, and select the Run as administrator option.
- Type the following command to view the current arp table cache on Windows 10 and press Enter: arp -a
- Type the following command to determine the MAC address of a remote device and press Enter: arp -a IP
In the command, make sure to replace IP with the address of the destination. For example, this command reveals the physical address of the 10.1.4.120 destination: arp -a 10.1.4.120
- Confirm the MAC (physical) address for the remote device.
After you complete the steps, you will be able to view the entire arp table and MAC address of a specific IP address.
If you want to know all the available options, use the «arp /?» command to list the available options with their corresponding descriptions.
7. Route
The route tool displays the routing table that allows Windows 10 to understand the network and communicate with other devices and services. The tool also offers some options to modify and clear the table as needed.
Like the arp tool, you typically do not have to worry about the routing table, but the command-line tool will come in handy when troubleshooting related problems.
To view or flush the routing table available on Windows 10, use these steps:
- Open Start.
- Search for Command Prompt, right-click the top result, and select the Run as administrator option.
- Type the following command to view the routing table known to Windows 10 and press Enter: route print
- Confirm the routing table information.
- (Optional) Type the following command to clear the routing table and press Enter: route -f
- Quick note: When running this command, the device will lose network connectivity since the system no longer understands the network topology. After running the command, restart the machine to allow the networking stack to rebuild the routing table. Usually, you should not have to clear the table unless you modify some of the entries and you need to reset the table.
Once you complete the steps, you will understand the routing table and how to clear the information.
You can also use the «route /?» command to view a list of available options, including options to change networking metrics, specify a gateway, add a new route, and much more. However, modifying these settings is usually not recommended unless you understand how the network works.
8. Netsh
On Windows 10, netsh (Network Shell) is a legacy command-line tool that allows you to display and change virtually any network configuration. For instance, you can use the tool to view the current network configurations, manage wireless connections, reset the network stack to fix most common problems, enable or disable the firewall, and a lot more.
To get started with the netsh command-line tool, use these steps:
- Open Start.
- Search for Command Prompt, right-click the top result, and select the Run as administrator option.
- Type the following command to view a list of the available commands (contexts) and press Enter: netsh /?
- Type the following command to view the list of available subcommands (subcontexts) for a specific option and press Enter: netsh CONTEXT-COMMAND
In the command, change the CONTEXT-COMMAND for the command that includes additional options. For example, this command shows the commands available to manage the firewall with netsh: netsh advfirewall /?
Once you complete the steps, you will know how to navigate the netsh contexts and subcontexts command to manage networking settings.
Reset system network stack
To reset the network stack to resolve common connectivity problems, use these steps:
- Open Start.
- Search for Command Prompt, right-click the top result, and select the Run as administrator option.
- Type the following command to reset the winsock stack and press Enter: netsh winsock reset
- Restart your computer.
After you complete the steps, the winsock configuration will reset, hopefully fixing the problems connecting to a network and the internet.
Export and import network configuration
To export the network configuration with netsh on Windows 10, use these steps:
- Open Start.
- Search for Command Prompt, right-click the top result, and select the Run as administrator option.
- Type the following command to export the current configuration for all the network adapters and press Enter: netsh -c interface dump>PATH\TO\EXPORTED.txt
In the command, replace the PATH\TO\EXPORTED.txt with the path and name of the file to store the configuration. For example, the following command exports the settings to the netshconfig.txt file: netsh -c interface dump>c:\netshconfig.txt
Once you complete the steps, you can open the file with any text editor to view the exported configuration.
Import network configuration
To import the network configuration settings with netsh, use these steps:
- Open Start.
- Search for Command Prompt, right-click the top result, and select the Run as administrator option.
- Type the following command to import the network configuration and press Enter: netsh -c interface dump>PATH\TO\IMPORTED.txt
In the command, replace the PATH\TO\EXPORTED.txt with the path and name of the file you want with the exported configuration. For example, the following command imports the settings from the netshconfig.txt file: netsh -f c:\netshconfig.txt
After you complete the steps, the new networking configuration will be imported and applied to Windows 10.
Enable and disable firewall
To enable the Windows 10 firewall with netsh, use these steps:
- Open Start.
- Search for Command Prompt, right-click the top result, and select the Run as administrator option.
- Type the following command to enable the default firewall and press Enter: netsh advfirewall set currentprofile state on
Once you complete the steps, the Windows Defender Firewall will enable on the device.
Disable firewall
To disable the Windows 10 firewall with netsh, use these steps:
- Open Start.
- Search for Command Prompt, right-click the top result, and select the Run as administrator option.
- Type the following command to disable the default firewall and press Enter: netsh advfirewall set currentprofile state off
Once you complete the steps, the Windows Defender Firewall will be disabled on the device.
On Windows 10, there are many tools you can use to change settings and troubleshoot networking issues using Command Prompt, PowerShell, and graphical applications. However, in this guide, we only focus on getting you started with some of the most common tools available in Command Prompt.
More resources
For more helpful articles, coverage, and answers to common questions about Windows 10 and Windows 11, visit the following resources:
- Windows 11 on Windows Central — All you need to know
- Windows 10 on Windows Central — All you need to know
Mauro Huculak has been a Windows How-To Expert contributor for WindowsCentral.com for nearly a decade and has over 15 years of experience writing comprehensive guides. He also has an IT background and has achieved different professional certifications from Microsoft, Cisco, VMware, and CompTIA. He has been recognized as a Microsoft MVP for many years.
Networking / Beginners
ipconfig is one of the most valuable tools you have available to check and troubleshoot basic TCP/IP settings. As shown in Table-1.
As a reminder, Listings-1 and 2 show the output of the ipconfig /all command with several key items highlighted.
Listing-1 identifies several pieces of key information shown by the ipconfig /all command. The Host Name value is the name of the computer. The Primary DNS Suffix
value indicates that the computer joined the network.mta domain. The Node Type of Hybrid value indicates that NetBIOS names are resolved using WINS first and then broadcast.
The NetBIOS name is created from the first 15 characters of the host name. If the first 15 characters of the host name are not unique, duplicate NetBIOS names will result.
Listing-1: ipconfig /all Windows IP configuration
C:\>ipconfig /all Windows IP Configuration Host Name . . . . . . . . . . . . : Success1 Primary Dns Suffix . . . . . . . : networking.mta Node Type . . . . . . . . . . . . : Hybrid IP Routing Enabled. . . . . . . . : Yes WINS Proxy Enabled. . . . . . . . : No DNS Suffix Search List. . . . . . : networking.mta
Listing-2 shows the configuration of a network interface card (NIC) on the system. Some systems may have more than one NIC, and all of the NICs will be displayed.
Listing-2: ipconfig /all NIC data
Ethernet adapter Local Area Connection: Connection-specific DNS Suffix . : Description . . . . . . . . . . . : Intel 21140-Based PCI Fast Ethernet Adapter (Emulated) Physical Address. . . . . . . . . : 00-03-FF-31-C4-CA DHCP Enabled. . . . . . . . . . . : No Autoconfiguration Enabled . . . . : Yes Link-local IPv6 Address . . . . . : fe80::1089:d255:6fa6:c8b%10(Preferred) IPv4 Address. . . . . . . . . . . : 192.168.3.10(Preferred) Subnet Mask . . . . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . . . . : 192.168.3.1 DNS Servers . . . . . . . . . . . : ::1 192.168.3.10 Primary WINS Server . . . . . . . : 192.168.1.55 NetBIOS over Tcpip. . . . . . . . : Enabled Tunnel adapter Local Area Connection* 8: Media State . . . . . . . . . . . : Media disconnected Connection-specific DNS Suffix . : Description . . . . . . . . . . . : isatap.{EE889A77-7A07-4D8B-A288-595E1FA01 800} Physical Address. . . . . . . . . : 00-00-00-00-00-00-00-E0 DHCP Enabled. . . . . . . . . . . : No Autoconfiguration Enabled . . . . : Yes
The Physical Address value shows you the media access control (MAC) address of the NIC.
If it’s a DHCP client, DHCP Enabled will be listed as Yes, and you’ll also see the IP address of the DHCP server as long as the client was able to get an IP address
from the DHCP server. In Listing-2, DHCP Enabled is set to No, so an IP address of a DHCP server is not available.
Autoconfiguration Enabled refers to Automatic Private IP Address (APIPA), and it is Yes by default. If the system couldn’t get an IP address from the DHCP server
and Autoconfiguration Enabled is sent to Yes, you’ll see an IPv4 address that starts with 169.254. If Autoconfiguration Enabled is set to No, then APIPA addresses are
not assigned when a DHCP server can’t be reached.
An IP address starting with 169.254 in a network with DCHP should send alarm bells ringing in your head. The client is unable to get a DHCP address.
A link-local IPv6 address always starts with fe80 and indicates that an IPv6 address isn’t assigned, but IPv6 is enabled.
You can use the subnet mask with the IPv4 address to determine the network ID. In Listing-2, the IP address of 192.168.3.10 and a subnet mask of 255.255.255.0
indicates a network ID of 192.168.3.0. The network ID must be the same as other hosts on the subnetwork, including the default gateway. The default gateway and the
IPv4 address share the same subnet mask.
The address of the Domain Name System (DNS) server is needed for most host name resolution. In Listing-2, the same computer is the DNS server. You can tell this
from the IPv6 loopback address (::1) and the same IPv4 address (192.168.3.10) that is assigned to the computer. If the DNS server address information is misconfigured,
you’ll probably experience problems with name resolution.
The «Troubleshooting Connectivity with ping» section shows how to use ping to verify name resolution is working.
A Windows Internet Naming Server (WINS) server resolves NetBIOS names. If the network includes a WINS server, the computer configuration should include the IP address
in the Primary WINS server section.
If you have a NIC but it isn’t connected, it will be listed as follows:
Media State . . . . . . . . . . . : Media disconnected
This is an obvious sign that the cable isn’t connected. If it does have a cable connected, check the link and activity lights on the NIC. If there are lights lit
but the Media State indicates disconnected, check the cabling to ensure the following:
Ethernet NICs have LED lights to indicate they are connected and have activity. Some have a single LED, and others have two LEDs.
- The cable is seated completely in the NIC.
- The cable is seated completely in the wall jack.
- The cable is seated completely in the switch port (the switch will usually be in a separate room).
- Each of the cables is wired correctly.
- The cables are not bent excessively (beyond tolerance) when installing.
One of the simplest ways to check the wiring is to identify a known good path to the switch and use it. For example, if another computer is working, unplug the cable
from that computer, and plug it into the computer you’re troubleshooting. If the problem computer now works, you know it’s the wiring. If it doesn’t work, you know
the problem is internal to the computer, and you may need to replace the NIC.
Before replacing hardware, you should always reboot the system first. It’s a simple step and cures many ills.
Although the ipconfig /all command is very valuable, the ipconfig command has other switches you can use. Table-2 shows these other commands with some comments.
Table-2 Important ipconfig commands
Command and switch | Comments |
---|---|
ipconfig /release ipconfig /release6 |
Releases an IPv4 lease (or an IPv6 lease with release6) obtained from a DHCP server. This doesn’t have any effect if a system has a statically assigned IP address instead of a DHCP-assigned IP address. |
ipconfig /renew ipconfig /renew6 |
Renews the IPv4 lease process (or IPv6 lease process with renew6) from a DHCP server. |
ipconfig /displaydns | Displays host cache (includes names from hosts file and names resolved from a DNS server). This is useful to determine whether a name is in cache with a specific IP address. |
ipconfig /flushdns | Remove items from host cache (removes items resolved from a DNS server but not items placed in cache from the hosts file). |
ipconfig /registerdns | Registers the computer’s name and IP address with a DNS server. This creates a host (A) record on the DNS server so that the DNS server can resolve the IP address for other computers. |
The ipconfig /registerdns command will work in a Microsoft domain using a DNS server. It will not create a record on an Internet DNS server from a home computer.
Here’s one way you can use the /displaydns and /flushdns switches. Suppose you are troubleshooting a problem where you can’t connect to another computer. You know
that the remote computer’s IP address is 192.168.1.5. However, when you use ipconfig /displaydns, it shows the remote computer with a different IP address of 10.5.4.3.
Use ipconfig /flushdns This should remove it from cache. If you enter ipconfig /displaydns but the faulty address is still in cache, it
indicates it’s in cache from the hosts file (not from DNS).
Try to Connect Again If the ipconfig/flushdns command removed the entry from cache, try to connect to the remote computer again. If it’s successful, the problem is
resolved. If not, use ipconfig /displaydns to see what address is displayed. If it’s still not the correct address (10.5.4.3 instead of 192.168.1.5), then DNS is
giving the wrong address for the computer. In other words, the problem is with DNS.
Use ipconfig /registerdns Go to the remote computer that you can’t connect to, and enter ipconfig /registerdns. This should correct the record in DNS.
Flush DNS and Try Again Go back to the original computer, and enter ipconfig /flushdns to remove the cache entries. Try to connect again, and it should be successful.
If not, check the cache with ipconfig /displaydns. If it shows the wrong address (10.5.4.3 instead of 192.168.1.5), you need to let the DNS administrator know.
- 01.11.2020
- 12 357
- 0
- 30.01.2021
- 5
- 4
- 1
- Содержание статьи
- Описание
- Синтаксис
- Параметры
- Примечания
- Примеры использования
- Справочная информация
- Добавить комментарий
Описание
IPCONFIG — Служит для отображения всех текущих параметров сети TCP/IP и обновления параметров DHCP и DNS. При вызове команды ipconfig без параметров выводится только IP-адрес, маска подсети и основной шлюз для каждого сетевого адаптера.
Синтаксис
ipconfig [/all] [/renew [адаптер]] [/release [адаптер]] [/flushdns] [/displaydns] [/registerdns] [/showclassid адаптер] [/setclassid адаптер [код_класса]]
Параметры
Параметр | Описание |
---|---|
/all | Вывод полной конфигурации TCP/IP для всех адаптеров. Без этого параметра команда ipconfig выводит только IP-адреса, маску подсети и основной шлюз для каждого адаптера. Адаптеры могут представлять собой физические интерфейсы, такие как установленные сетевые адаптеры, или логические интерфейсы, такие как подключения удаленного доступа. |
/renew [адаптер] | Обновление конфигурации DHCP для всех адаптеров (если адаптер не задан) или для заданного адаптера. Данный параметр доступен только на компьютерах с адаптерами, настроенными для автоматического получения IP-адресов. Чтобы указать адаптер, введите без параметров имя, выводимое командой ipconfig. |
/release [адаптер] | Отправка сообщения DHCPRELEASE серверу DHCP для освобождения текущей конфигурации DHCP и удаление конфигурации IP-адресов для всех адаптеров (если адаптер не задан) или для заданного адаптера. Этот адаптер отключает протокол TCP/IP для адаптеров, настроенных для автоматического получения IP-адресов. Чтобы указать адаптер, введите без параметров имя, выводимое командой ipconfig. |
/flushdns | Сброс и очистка содержимого кэша сопоставления имен DNS клиента. Во время устранения неполадок DNS эту процедуру используют для удаления из кэша записей отрицательных попыток сопоставления и других динамически добавляемых записей. |
/displaydns | Отображение содержимого кэша сопоставления имен DNS клиента, включающего записи, предварительно загруженные из локального файла Hosts, а также последние полученные записи ресурсов для запросов на сопоставление имен. Эта информация используется службой DNS клиента для быстрого сопоставления часто встречаемых имен без обращения к указанным в конфигурации DNS-серверам. |
/registerdns | Динамическая регистрация вручную имен DNS и IP-адресов, настроенных на компьютере. Этот параметр полезен при устранении неполадок в случае отказа в регистрации имени DNS или при выяснении причин неполадок динамического обновления между клиентом и DNS-сервером без перезагрузки клиента. Имена, зарегистрированные в DNS, определяются параметрами DNS в дополнительных свойствах протокола TCP/IP. |
/showclassid адаптер | Отображение кода класса DHCP для указанного адаптера. Чтобы просмотреть код класса DHCP для всех адаптеров, вместо параметра адаптер укажите звездочку (*). Данный параметр доступен только на компьютерах с адаптерами, настроенными для автоматического получения IP-адресов. |
/setclassid адаптер [код_класса] | Задание кода класса DHCP для указанного адаптера. Чтобы задать код класса DHCP для всех адаптеров, вместо параметра адаптер укажите звездочку (*). Данный параметр доступен только на компьютерах с адаптерами, настроенными для автоматического получения IP-адресов. Если код класса DHCP не задан, текущий код класса удаляется. |
/? | Отображение справки в командной строке. |
Примечания
- Команда ipconfig является эквивалентом для командной строки команды winipcfg, имеющейся в Windows Millennium Edition, Windows 98 и Windows 95. Хотя Windows XP не имеет графического эквивалента команде winipcfg, для просмотра и обновления IP-адреса можно воспользоваться окном «Сетевые подключения». Для этого откройте окно Сетевые подключения, щелкните правой кнопкой мыши сетевое подключение, выберите команду Состояние, а затем откройте вкладку Поддержка.
- Данная команда доступна только на компьютерах с адаптерами, настроенными для автоматического получения IP-адресов. Это позволяет пользователям определять, какие значения конфигурации были получены с помощью DHCP, APIPA или другой конфигурации.
- Если имя адаптер содержит пробелы, его следует заключать в кавычки (т. е. «имя_адаптера«).
- В именах адаптеров, задаваемых для команды ipconfig, поддерживается использование подстановочного знака звездочки (*) для задания имен, начинающихся с указанной строки или содержащих указанную строку. Например, имя Подкл* будет включать все адаптеры, начинающиеся со строки «Подкл», а имя *сет* — все адаптера, содержащие строку «сет».
- Эта команда доступна, только если в свойствах сетевого адаптера в объекте Сетевые подключения в качестве компонента установлен протокол Интернета (TCP/IP).
Примеры использования
Чтобы вывести основную конфигурацию TCP/IP для всех адаптеров, введите:
ipconfig
Чтобы вывести полную конфигурацию TCP/IP для всех адаптеров, введите:
ipconfig /all
Чтобы обновить конфигурацию IP-адреса, назначенного DHCP-сервером, только для адаптера Подключение по локальной сети, введите:
ipconfig /renew "Подключение по локальной сети"
Чтобы сбросить кэш сопоставления имен DNS при наличии неполадок в сопоставлении имен, введите:
ipconfig /flushdns
Чтобы вывести код класса DHCP для всех адаптеров с именами, начинающимися со слова Подключение, введите:
ipconfig /showclassid Подключение*
Чтобы задать код класса DHCP TEST для адаптера Подключение по локальной сети, введите:
ipconfig /setclassid "Подключение по локальной сети" TEST
Справочная информация
Last Updated :
08 Jan, 2025
IPCONFIG is a command-line utility windows, ReactOS, macos and collection of other Operating systems, which is used to display and manage network configuration settings such as IP addressing, subnetting mask, DNS addressing, Port identificaition, Default gateways etc.It is a global and versatile CLI used for trobuleshooting, configuting and also used to make the optimization work in connectivity.
Key Functions IPCONFIG
- Displaying Network Configurations: ipconfig displays current TCP/IP network configurations with details including
- Current Ip Address(IPv4 and IPv6)
- Subnet masks
- Default Gateways
- DNS server addresses
- Refreshing DHCP and DNS settings : IPCONFIG is used to refresh the Dynamic host Configuration Protocol(DHCP) and Domain Name System(DNS) settings, by making sure that they are up to date to the IP Address and DNS informations from the server
- Releasing and renewing a new IP address: Used to release and renewing a new IP address which is useful in network debugging and trobuleshooting including the pentesting the System.
- Flushing DNS Cache: ipconfig also helps to clear the content of stale DNS resolver cache and make sure that the system gets the latest DNS resolver cache.
MACOS v/s Windows
In Windows and ReactOS ipconfig first force to refreshes the DHCP IP address of the host computer and then requests a new and a different IP address. In macOS, IPCONFIG is used at the command-line interface to control the bootstrap protocol and DHCP client, handling the network configuration similar to windows but in macos-based specific behavior.
Characteristics of IPCONFIG
- IPCONFIG provides settings for the IPv4 IP layer for TCP/IP.
- The maximum length for the connection request queue is specified using IPCONFIG.
- All the updation in IP layer of TCP/IP is done using IPCONFIG.
- IPCONFIG is used to do checksum processing for IPv4 packets.
Advantages of IPCONFIG
- It displays full configuration of the system.
- It can be used to refresh DHCP leases, reregister the DNS names and request new IP address.
- It displays DNS resolver cache information and can flush them too.
- It can display all the class id’s allowed.
Disadvantages of IPCONFIG
- It is less efficient as it uses netlink socket to transfer information between kernel and user.
- Implementation is difficult as it is implemented on console.
- Memorization of commands is required, which is a tough task.
- Beginner’s may find it difficult to execute because of command line dependency.
Restrictions of IPCONFIG
- Windows only Focused: This is initially made for Windows and ReactOS, providing only limiting functinality to the cross platform os like macOs.
- Limited Scope: This is only for the basic tasks such as viewing IP address, releasing and renewing them with ease but cant able to to advanced network configurations.
- No Persistant Changes: This dont change any permanent changes to the network but for temmporary only
- No Troubleshooting Automations: While useful for network configuration but can’t able to diagonse the problem and also can’t able to fix by troubleshooting them automatically.
Conclusion
Ipconfig is a powerful CLI(Command line Interface) based tool which provide a wide range of functions for managaing and troubleshooting network configuration settings. By understanding various concepts of IPCONFIG we can able to use ipconfig to troubleshoot the problems on the network, master the power of IP address allocations such generating IP, renewing IP and able to diagnose the connectivity issues throughout our systems.