Windows ipconfig Common Command Guide

IP & Network 閲覧

Common ipconfig Commands

  • ipconfig: Displays basic information for the current network interfaces, including IP address, subnet mask, and default gateway. Useful for quickly checking network status.
  • ipconfig /all: Shows full network configuration details such as MAC address, DNS servers, and DHCP status. Useful for in-depth network diagnostics.
  • ipconfig /release: Releases the current DHCP-assigned IP address. Used to disconnect from the network or prepare to obtain a new IP.
  • ipconfig /renew: Requests a new IP address from the DHCP server. Often used to resolve IP conflicts or restore connectivity.
  • ipconfig /flushdns: Clears the local DNS cache, commonly used to fix domain name resolution errors or incorrect website access.

Usage Tips

If you encounter network connectivity issues, try running ipconfig /release and ipconfig /renew to get a new IP. For domain name resolution problems, use ipconfig /flushdns to refresh the DNS cache.

Combining ipconfig with Other Diagnostic Tools

ipconfig works best as part of a broader diagnostic workflow. After confirming your IP configuration, use ping 8.8.8.8 to test basic internet connectivity independent of DNS, then ping google.com to verify DNS resolution. If the first succeeds but the second fails, you have a DNS problem rather than a network connectivity problem — and that distinction alone can save significant diagnostic time.

Automating ipconfig for Monitoring

For system administrators managing multiple machines, consider wrapping ipconfig in a PowerShell script to periodically log your IP configuration to a file. This creates an audit trail that makes it easy to detect when an IP address changes unexpectedly — a common indicator of DHCP misconfiguration or a rogue device on the network.

The command ipconfig /all | Out-File -FilePath "C:\net_log.txt" -Append appended to a scheduled task gives you a lightweight and dependency-free network state audit log without any additional software.