Understanding Ipconfig and Ipconfig Commands

Ipconfig is a powerful tool built into the Windows operating system as an easy way to access and change network settings. Once users understand how to use the command, they can use it to view IP information, troubleshoot, fix DNS and IP issues, and more. In this article, we’ll cover what ipconfig is, how to use it, several common ipconfig commands like ipconfig /all and ipconfig /flushdns, and what you should know about the tool and its basic functionality moving forward.

What is ipconfig?

Ipconfig is used to view and configure the network settings on a Windows computer. It’s often used to troubleshoot network issues, like connectivity problems or incorrect IP addresses. It also works to view the current IP configuration of a computer, as the command displays the IP addresses assigned to their network adapters as well as the default gateway and DNS servers.

The ipconfig command is available on all versions of Windows, including Windows 7, 8, 10, and 11. Users don’t need any additional software installed to use it, which makes the command convenient.

Results from running the ipconfig command

What is ipconfig used for?

The ipconfig has many uses, as it’s quite a versatile tool. It has basic functions, such as viewing IP (Internet Protocol) address information and troubleshooting network issues, which is helpful for all users. However, it also has more advanced functions better for professional use, such as blocking scripts and diagnosing VPN problems.

Using ipconfig to view IP address information

One of the primary uses of the ipconfig command is to display the current IP information and configuration of a computer. This information includes the IP address, the subnet mask, and the default gateway of each active network interface. If you run the ipconfig command on its own, it will provide an output with the following information for each network adapter:

The output may look like one of the following examples:

Ethernet adapter Ethernet
IP address: 192.168.1.100
Subnet mask: 255.255.255.0
Default gateway: 192.168.1.1
Wireless LAN adapter WiFi
IP address: 192.168.2.100
Subnet mask: 255.255.255.0
Default gateway: 192.168.2.1

You can also use the /all command to get more detailed information, such as the physical address (MAC address) of the adapter, the DHCP lease time, and the DNS hostname.

Using ipconfig to monitor network performance

Ipconfig helps monitor network performance by displaying information about the IP addresses and other network settings. It helps identify network bottlenecks, detect connectivity issues, and troubleshoot other network-related problems. You can also use the command to gather information like the IP address, subnet mask, and DNS servers assigned to a network to identify potentially troublesome patterns and trends in network usage.

Using ipconfig in scripts

Ipconfig works in scripts to automate network configuration tasks or to gather information about network settings. This is useful for managing large numbers of computers, as well as for monitoring network performance. Users who run their own networks or servers will find ipconfig useful for this purpose.

Using ipconfig to diagnose VPN problems

Ipconfig can be used to view the IP addresses and other network settings of a computer when it is connected to a virtual private network (VPN). This can be useful for troubleshooting VPN connectivity issues or for identifying the cause of slow VPN performance.

Ways to use ipconfig to troubleshoot network issues

One of the things ipconfig can be used for is troubleshooting network issues. Because the command views the IP information and ensures IP address configuration, it helps users experiencing network issues who need to diagnose the problem.

In general, ipconfig helps diagnose connectivity issues. If a computer can’t connect to the Internet or other network resources, use ipconfig to view the IP configuration and ensure that the correct IP addresses and default gateway are being used. Furthermore, if two computers on the same network are using the same IP address, ipconfig works to resolve those IP conflicts and view the current IP addresses of the devices.

Renewing DHCP leases

You can also use ipconfig to diagnose issues with DHCP. DHCP, or Dynamic Host Configuration Protocol, is a network protocol allowing servers to automatically assign IP addresses and other network configuration parameters to devices on a network. When a device connects to a network, it sends a broadcast message requesting an IP address.

The DHCP server then assigns an IP address to the device along with the subnet mask, default gateway, and DNS server information. This process is known as leasing an IP address.

Leases have limited duration and must be renewed, but there are sometimes issues. The computer may not receive an IP address from a DHCP server, which could result in a 169.254 IP address. However, the ipconfig command can request a new DHCP lease for the specified adapter.

It can replace an expired address or help if your current IP assignment is causing problems. Therefore, ipconfig can help troubleshoot network connectivity issues related to DHCP or IP address assignment.

It's important to note, however, that renewing a DHCP lease will release the current IP and request a new one, so any connections or data transfers that were using the current IP address will be disrupted.

Flushing the DNS cache

Ipconfig also helps troubleshoot domain name system (DNS) issues. The domain name system is a hierarchical decentralized naming system for computers, services, or other resources connected to the Internet or a private network. It translates domain names, which are easy for us to understand, to IP addresses, which are easy for computers to understand.

When a computer looks up a domain name, it caches the IP address of that domain name. The computer memory stores the cache, which it uses to speed up future lookups of the same domain. However, if the IP of the domain changes, the computer’s cache may still contain the old IP. This causes problems connecting to the site or domain.

You can use ipconfig to solve this problem by flushing the DNS cache. Ipconfig clears the cache and forces the computer to look up the domain name’s IP again, thus resolving the error and improving connectivity.

Though the command isn’t a magic fix for all network issues, it helps quickly view and configure network settings, which helps to resolve connectivity problems and ensure that the computer is properly configured for the network.

Common ipconfig commands and switches

Ipconfig offers several options and switches that can be used to customize the information displayed in the command or change the actions performed. The basic syntax of the ipconfig command is “ipconfig [options],” where “options” are the optional parameters used to modify the command’s output. Some of these most used options include:

  • ipconfig /all: Displays detailed information about all adapters, including the IP address, subnet mask, default gateway, DHCP server, and DNS servers
  • ipconfig /release: Releases the DHCP lease for the specified adapter
  • ipconfig /renew: Requests a new DHCP lease for the specified adapter
  • ipconfig /flushdns: Clears the DNS cache on the computer
  • ipconfig /? or /help: Displays all the available options for the ipconfig command
ipconfig /release command executed

If you run the ipconfig command on its own with no parameters, it displays the IP configuration of all active network interfaces on the computer. However, you can also specify a network interface by adding its name to the command. For example, ipconfig /all displays detailed information about all network interfaces, while ipconfig /all Ethernet displays detailed information specifically about the Ethernet interface. View the breakdown of information displayed by /all below:

Physical AddressThe MAC address or hardware address of your network adapters
DHCP EnabledShows what your network connection is using: static IP address or DHCP
IPv4 AddressIndicates the IP address of your Windows device
Subnet MaskDistinguish between a host address and a network address in the IP address
Lease ObtainedThe time your hardware received the IP address
Default GatewayThe address of the router interface
DHCP ServerAutomatically provides and assigns IP addresses to your computer
DNS ServersServers that translate domain names into IP addresses

The five commands listed above are the most common configurations; however, there are also more advanced commands to perform additional tasks.

Advanced ipconfig commands

In addition to the basic functionality of viewing and managing the IP configuration of a Windows computer, ipconfig also offers advanced options that can be used for more complex network management tasks.

One advanced option is the ipconfig /displaydns command, which shows the contents of the DNS resolver cache. It can help troubleshoot DNS issues, as it allows you to view the DNS records stored locally on the computer.

The ipconfig /registerdns command refreshes all DHCP leases and re-registers DNS names. It can help resolve problems between your computer or system and the DNS server.

Another advanced option is the ipconfig /setclassid command, which allows users to configure the DHCP class ID for a network adapter. The DHCP class ID is a value sent to the DHCP server to identify the specific configuration that should be applied to a network adapter. It can help configure, for example, a specific DHCP setting for wireless adapters and then a different setting for wired adapters.

The /showclassid goes in conjunction with the /setclassid command. It displays all the DHCP class IDs allowed for a certain adapter. It also helps when setting a different class ID as it indicates the parameters or limits for a certain adapter.

Additionally, the ipconfig command allows users to change the IP address, subnet mask, and default gateway of a network adapter by using the /setaddress, /setmask, and /setgateway options, respectively. These options, then, allow the user to manually configure their network adapter’s IP settings.

Use these commands with caution, as they do impact network connectivity. We recommend them only for advanced users with a solid understanding of network architecture, IP addresses, and the DHCP protocol, such as network administrators.

Ipconfig error messages

While ipconfig is a powerful tool for troubleshooting network issues, there are some common error messages that may appear when using the tool. Some of the most common error messages include:

  • “Access is denied” error: This error message appears when you don’t have the necessary permissions to run ipconfig. Therefore, to fix this, run the command prompt as an administrator.
  • “Windows IP configuration” error: This message appears when no network adapters were installed on the computer or when all network adapters are disabled. To fix this, check for proper installation and enabling of the network adapters.
  • “Media disconnected” error: When the network cable is improperly connected or not functioning properly, this error message appears. To fix it, check the connections and ensure proper installation and enabling of the network adapters.
  • “Could not release DHCP lease” error: This error message appears when the DHCP lease couldn’t be released, likely because the DHCP server is unavailable or there is a problem with the network adapter. To fix it, check the network connections and make sure the DHCP server functions properly.
  • “The system cannot find the file specified” error: When this message appears, it either means the user incorrectly typed the command or they did not install ipconfig on the computer altogether. To fix it, check the command or install ipconfig.

Keep in mind that these error messages aren’t an exhaustive list. Other error messages may appear when using ipconfig as well. In case of any error messages, check the command and ensure that the network settings are properly configured.

How to access ipconfig on Windows and Mac

Windows users are used to entering the ipconfig command to show the full configuration of their computer system. On Apple's Mac, you won't get any network information from this command. With Mac, you need to run the ifconfig command, which is the Windows ipconfig Mac alternative.

To access the command on Windows:

  1. Right-click the Start menu or hit Win+X. 
  2. Select the command prompt from the available options.
  3. Type ipconfig. Then, press Enter.

To access the command on Mac:

  1. Press cmd+Space.
  2. Type Terminal. Then, hit Enter.
  3. At the Terminal prompt, type ifconfig. Then, hit Enter.

You'll find the information regarding your physical IP address, subnet mask, and default gateway.

Comparing ipconfig to other network troubleshooting tools

While ipconfig is a powerful tool for troubleshooting network issues, it isn’t the only tool available. Other network troubleshooting tools that work in conjunction with or as an alternative to ipconfig, including:

  • Ping, a command-line utility that tests connectivity to a remote host by sending ICMP echo request packets and waiting for a response
  • Tracert, a command-line utility that displays the path taken by packets across an IP network
  • Netstat, a command-line utility that displays active TCP/IP connections and their status, including the local and remote IP addresses and ports
  • Netsh, a command-line utility that's used to update network configuration settings
  • Nslookup, a command-line utility that displays information about a domain name, such as the IP address and the name servers
  • Event Viewer, a graphical tool that displays system and application log data, which then can be used to troubleshoot issues related to network connectivity or other problems
  • Device Manager, a graphical tool that displays the status of hardware devices, including network adapters

Each tool's own strengths make it the best choice to troubleshoot different types of network issues. For example, ipconfig is good for viewing and configuring network settings. But the ping command is useful for testing connectivity to a remote host. Additionally, the tracert command is useful for identifying the path packets take across a network. 

Frequently asked questions

What do I use the ipconfig command for?

Use ipconfig to display the IPv4 address, IPv6 address, subnet masks, and the default gateway to each IP.

What are the 3 main commands in ipconfig?

Ipconfig has many purposes and commands. However, the three most popular are /release, /renew, and /all. These commands show network data and refresh your IP when necessary.

How do I use ipconfig command in Windows 10 or Mac?

Users can access this command, or a variation of it, on any computer.

For Windows, go to the start menu and open the command prompt by typing cmd. Then, enter ipconfig for the basic information. Alternatively, enter the proper associated command for the task if you're looking for something more specific.

For MacOS, open Finder and choose Applications. Next, select the Utilities folder and open Terminal, which is the Mac version of Windows' command prompt. Finally, enter ifconfig to perform the same function.

Will ipconfig get my IP address?

Yes, the command will retrieve your IP address. When you launch the ipconfig command on your system, your IP address will be the IPv4 address.