What command can you use to display TCP IP configuration information?

The ipconfig command is used to display TCP/IP information from all network adapters on your computer. The most common reason to use ipconfig is to find IP Address information on your Windows computer.

Ipconfig can also be used for basic network troubleshooting such as releasing and renewing DCHP and DNS settings.

In this guide, you will learn how to use the Windows ipconfig command and its most useful command options.

Ipconfig Syntax

You can view the full command syntax by typing ipconfig /? and pressing enter.

Here are the most popular ipconfig parameters.

/all: Display full configuration information.

/displaydns: Display the contents of the DNS Resolver Cache.

/flushdns: Flush the DNS resolver cashe.

/registerdns: Refreshes all DHCP leases and re-registers DNS names

/release: Release the IPv4 address for the specified adapter.

/renew: Renew the IPv4 address for the specified adapter.

How To Use ipconfig Command (Examples)

Ipconfig command is very easy to use. The command can be run from the windows command prompt or PowerShell. In the search box type “command prompt” and click on the command prompt app.

1. Use the ipconfig command to get basic TCP/IP configuration

The ipconfig with no parameters will get the basic TCP/IP configuration for all network adapters.

ipconfig
What command can you use to display TCP IP configuration information?

You can see above the command displays the IP Address, Subnet Mask, and Default gateway on my computer, It will display these details for all network adapters.

2. Use ipconfig /all to Display Full TCP/IP Configuration

To view all network adapter configuration details you need to use the /all option.

ipconfig /all
What command can you use to display TCP IP configuration information?

You can see above the /all option includes the following additional details.

  • Physical Address
  • DHCP Enabled
  • Autoconfiguration Enabled
  • Lease Obtained
  • Lease Expired
  • DHCP Server
  • DNS Servers
  • Primary Wins Server
  • NetBIOS over Tcpip

When troubleshooting network problems these additional details are helpful.

3. Use ipconfig /displaydns to View the DNS Client Resolver Cache

When you connect to a website or your computer communicates with another device DNS is used to resolve the IP address to the hostname. These host names will get cached on your local computer. To view the local DNS cache use this command.

ipconfig /displaydns
What command can you use to display TCP IP configuration information?

4. Use ipconfig /flushdns Command to Clear the DNS Cache

There are times when the DNS cache will have an old entry. This can cause networking problems and you will need to remove the bad entry. This is done with the /flushdns parameter.

ipconfig /flushdns
What command can you use to display TCP IP configuration information?

5. Manually Register DNS Records With ipconfig /registerdns Command

Sometimes a client fails to register or update its DNS record. This command will initiate a dynamic DNS update between the client and DNS server.

ipconfig /registerdns

6. Release DHCP Address With ipconfig /release

This command sends a DHCPRELEASE message to the DHCP server to release the current DHCP configuration. This will release the network adapter configuration if it is configured for DHCP.

ipconfig /release

7. Renew DHCP configuration with ipconfig /renew

Renews DHCP configuration for all adapters

ipconfig /renew

As you can see the ipconfig command is very easy to use. This command can quickly get the IP address information from your computer and display additional TCP/IP details.

Learn 4 Linux and Windows commands to display IP address settings for network configuration and troubleshooting.


What command can you use to display TCP IP configuration information?

One fundamental component of network troubleshooting on a server is displaying the current IP address configuration. Doing so allows system administrators to confirm the address is assigned and correct.

Consider the following example: A system cannot be reached from across the network. As part of troubleshooting, the administrator checks the system’s IP address.

The IP address displayed on the system is 169.254.10.103. The administrator should recognize this as an Automatic Private IP Address (APIPA) configuration or link-local address that indicates the device could not successfully lease an IP address configuration from a Dynamic Host Configuration Protocol (DHCP) server.

Because the administrator can view the IP settings, they now have a course of action to make the system accessible again.

Like many tasks, displaying the IP address is more quickly done via the command line interface (CLI) than the graphical user interface (GUI). Let’s discuss four ways you can display IP configurations in both Linux and Windows.

Displaying IP Configurations in Linux

The common tool for displaying IP address information in Linux has been ifconfig. While many distributions still ship with ifconfig, it is gradually being replaced with the ip command. During this transition, it’s critical to know how to work with both.

Using the ifconfig Command

What command can you use to display TCP IP configuration information?

Figure 1: Display IP address information with ifconfig

The ifconfig command displays the network configuration for active interfaces. Depending on the system, this output can be very long, so it’s also possible to display the configuration for specific interfaces. To see the IP address for the enp0s3 interface, for example, type the following command:

# ifconfig enp0s3

Some configuration is also possible via the ifconfig command. For example, you can up or down NICs (enable or disable) by using this command:

# ifconfig enp0s3 down

# ifconfig enp0s3 up

It’s important to note that the ifconfig command is one of several choices to display the IP address configuration on macOS.

The ifconfig command even allows administrators to set a static IP address on an interface. Here’s an example of configuring the 192.168.2.200/24 address and subnet mask on enp0s3:

# ifconfig enp0s3 192.168.2.200 netmask 255.255.255.0

Also, note that you can use the route command to add a default gateway after setting the static IP address with ifconfig. For example, to set a default gateway of 192.168.2.1 to the system, type:

# route add gateway 192.168.2.1 enp0s3

Using the ip Command

The ip command is relatively new to the Linux scene. It’s more robust and more complex than ifconfig. Some Linux distributions have both tools installed but be aware that many have just one.

The syntax of the ip command is different from ifconfig. It uses a command subcommand structure. Here’s a basic example of displaying the IP configurations of all interfaces:

# ip addr

There are many subcommands available for ip beyond the addr example displayed above. Routing and link configurations can also be manipulated.

The subcommand syntax is flexible. Formal training on the ip command might show the following example for displaying all IP address information:

# ip address show

However, this command can be abbreviated down to ip addr or even just ip a.

Like ifconfigip addr displays the configuration of all active interfaces. To focus the command on the enp0s3 interface, simply type the following:

# ip addr show enp0s3

What command can you use to display TCP IP configuration information?

Figure 2: Display IP address information with ip addr

Finally, like ifconfig, the ip command can configure a static IP on a NIC. Here’s an example, using the same addressing information from the ifconfig example above:

# ip addr add 192.168.2.200/24 dev enp0s3

It’s a good idea for Linux administrators to get used to both the ifconfig and ip commands for displaying network configurations. Confirming IP address settings is critical enough that even Windows administrators should have a basic understanding of these two commands in case they are ever signed into a Linux device.

Displaying IP Configurations on Windows

Many Windows administrators are comfortable with displaying network information through the GUI. There are several ways of accessing this information, including the server manager console and the properties of the network interface. However, it’s useful to display network settings from the command line.

Using the ipconfig Command

The ipconfig command displays the basic IP addressing information for each network interface on the Windows system. This information includes both the IP address and subnet mask.

PS C:\> ipconfig

However, more verbose output can be useful. By adding the /all switch to ipconfig, administrators can display a great many useful settings, including the Media Access Control (MAC) address, DHCP lease information, name resolution servers and the system’s fully qualified domain name (FQDN).

PS C:\> ipconfig /all

Most Windows administrators benefit from knowing all the switches associated with ipconfig, but two of the critical options are /release and /renew. On a system configured as a DHCP client, the /release switch clears the DHCP configuration. The /renew switch forces a new DHCP lease generation process, permitting the client to receive updated network settings from a DHCP server.

Using PowerShell Network cmdlets

Microsoft continues to emphasize the use of Windows PowerShell as the preferred CLI for modern Windows systems. PowerShell includes several network cmdlets to display and manipulate network settings.

For those who are less familiar with PowerShell’s syntax, recall that a cmdlet is a combination of a verb as the first word and a noun as the second word. For example, the Get-Date cmdlet specifies the system should “get” or retrieve a value, and that value is specifically the date.

The simplest cmdlet for showing IP address settings is Get-NetIpAddress. This cmdlet displays the address for all active interfaces. Additional parameters can be added to better narrow the output.

Here’s the basic cmdlet:

PS C:\> Get-NetIpAddress

Here’s the cmdlet with a more elegant output:

PS C:\> Get-NetIpAddress | Format-Table

Adding the -AddressFamily IPv6 parameter to the cmdlet causes it to display only IPv6 addressing information.

What command can you use to display TCP IP configuration information?

 

Figure 3: Display IP address information with Windows PowerShell


There are other similar cmdlets that provide additional flexibility or information.

For example, to display interface-specific information, type:

PS C:\> Get-NetIpInterface

What command can you use to display TCP IP configuration information?

 

Figure 4: Display interface information with Windows PowerShell

Or, to display configuration details such as name resolution servers and interfaces, type:

PS C:\> Get-NetIpConfiguration

Displaying IP Address Settings

One of the earliest steps in troubleshooting network connection problems is to verify the IP address configuration of the source and destination devices. Linux sysadmins should have a general idea of how to check these settings on a Windows box, and Windows admins should know similar commands on Linux. Since many router operating systems are based on the Linux kernel, the knowledge of commands such as ifconfig and ip addr is very practical.

While administrators can use the Windows GUI tools to display this information, it’s often more efficient to use the command line. Linux administrators may not have GUI utilities available, especially on server deployments.

 

Get more tutorials like this right in your inbox with CompTIA’s IT Career Newsletter. Subscribe today, and you can save 10% off your next CompTIA purchase.

What command shows you TCP IP information?

Commands used to display TCP/IP and network information include NETSTAT, PING, and TRACERTE.

What command would you enter to display the IP configurations?

First, click on your Start Menu and type cmd in the search box and press enter. A black and white window will open where you will type ipconfig /all and press enter. There is a space between the command ipconfig and the switch of /all. Your ip address will be the IPv4 address.

Which command displays all current TCP IP network configuration values?

ipconfig (standing for "Internet Protocol configuration") is a console application program of some computer operating systems that displays all current TCP/IP network configuration values and refreshes Dynamic Host Configuration Protocol (DHCP) and Domain Name System (DNS) settings.

What is the TCP IP command line?

TCP/IP is part of the underlying structure of your system. It allows you to communicate with another terminal or system merely by executing a command or program. TCP/IP is part of the underlying structure of your system.