- Home
- Logging Guide
- What is ipconfig
How to use ipconfig commands to troubleshoot network issues
In this page
- What is ipconfig?
- What is the ipconfig command used for?
- How to access ipconfig on Windows and Mac
- Risks of adversaries accessing ipconfig commands
- How ManageEngine EventLog Analyzer helps in mitigating identity-based risks
What is ipconfig?
ipconfig is a command-line utility available in Windows, ReactOS, and macOS that provides users with detailed information about their network configuration. It is primarily used for displaying and managing network settings, such as IP addresses, subnet masks, default gateways, and DNS server addresses. This tool plays a crucial role in troubleshooting network connectivity issues and optimizing network configurations.
What is the ipconfig command used for?
The ipconfig command is used to display all current TCP/IP network configuration values and refresh DHCP and DNS settings. It helps users view their IP address, subnet mask, default gateway, and other network-related information. Here's a detailed summary of its functionalities:
1. Display basic network configuration:
Running ipconfig without any parameters shows the IP address, subnet mask, and default gateway for all network adapters on the system.
ipconfig
When executed, it provides information such as:
- Ethernet or wireless adapter name: Identifies the type of network connection.
- IPv4 address: The unique IP address assigned to your device.
- Subnet mask: Defines the range of IP addresses that are available within a network.
- Default gateway: The IP address of the router that connects your device to the internet.
Here’s an example of what you would see after running ipconfig:
Ethernet adapter Local Area Connection:
Connection-specific DNS Suffix . :
IPv4 Address. . . . . . . . . . . . : 192.168.1.10
Subnet Mask . . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . . . : 192.168.1.1
In this output:
- The IPv4 address is 192.168.1.10, which is your device's unique identifier on the local network.
- The subnet mask is 255.255.255.0, indicating that devices within this subnet can communicate directly with each other.
- The default gateway is 192.168.1.1, which routes traffic from your local network to other networks, including the internet.
2. Detailed network information:
To get comprehensive details about all network adapters, including DNS and DHCP server information, use:
ipconfig /all
This command provides extensive information about network adapters, such as their MAC address, DHCP status, and DNS servers, on top of the details provided by running the ipconfig command.
When you execute the command ipconfig /all, it displays detailed information for each network adapter, including:
- MAC address: The unique identifier assigned to the network interface for communications at the data link layer.
- DHCP enabled: Indicates whether the adapter is configured to obtain an IP address automatically via DHCP.
- DHCP server: The server responsible for assigning IP addresses to devices on the network.
- DNS servers: The servers that resolve domain names into IP addresses, allowing web browsing and other internet services.
- Lease obtained: The date and time when the current IP address was assigned to the adapter.
- Lease expires: The date and time when the current lease will expire.
3. Release and renew IP addresses:
If your device is configured to obtain an IP address automatically via DHCP, you can release the current IP address with:
ipconfig /release
This command sends a message to the DHCP server to release your current IP address. After executing this command, your IP address will change to 0.0.0.0, indicating that it has been released.
After releasing, you can request a new IP address using:
ipconfig /renew
This command requests a new IP address from the DHCP server. It may take a few moments to complete. If successful, you will see a new IP address assigned to your network adapter.
4. Flush the DNS cache:
The DNS cache stores the IP addresses of web servers that your computer has recently accessed, which can sometimes lead to problems if the cached data becomes outdated or corrupted.
To clear the DNS resolver cache (which can help resolve DNS-related issues), use:
ipconfig /flushdns
This command removes all entries in the DNS cache, forcing the system to retrieve fresh records from the DNS server.
By regularly flushing your DNS cache when experiencing network issues or after significant changes to your network configuration, you can maintain optimal connectivity and performance.
5. Display the DNS cache:
Displaying the DNS cache using the ipconfig command in Windows allows you to see the current DNS records stored on your computer. This can be useful for troubleshooting network issues, understanding which websites have been accessed recently, and verifying DNS resolution.
You can view the contents of the local DNS cache with:
ipconfig /displaydns
After executing this command, you will see a list of all DNS records currently stored in your local DNS cache. This list includes various details, such as:
- Record type: Indicates whether it is an A record (address record), CNAME (canonical name), MX (mail exchange), etc.
- Host name: The domain name that corresponds to the IP address.
- Time to live: The duration in seconds that the record is considered valid and can be cached.
- Data length: The size of the DNS record in bytes.
- Data: The actual IP address or other relevant data associated with the host name.
6. Registering a DNS from the command line:
The ipconfig /registerdns command initiates a manual registration of the DNS names and IP addresses configured on your computer.
ipconfig /registerdns
After executing this command, you should see a message indicating that the DNS registration process has started. The command will attempt to register your computer's DNS records with the DNS server configured in your network settings.
7. Assigning DHCP class IDs:
The ipconfig /setclassid command allows users to configure the DHCP class ID for network adapters.
The basic syntax for the ipconfig /setclassid command is:
ipconfig /setclassid <adapter> <classID></classID>
- <adapter>> This specifies the name of the network adapter you want to configure. You can find adapter names by simply typing ipconfig in the Command Prompt without any parameters.
- <classID>> This is a string that identifies a specific configuration for DHCP options. If you do not specify a class ID, the current class ID will be removed from the specified adapter.
Executing this command allows you to assign specific DHCP class IDs to network adapters, which can be used by DHCP servers to apply different settings based on the class ID. This can include different IP address ranges, DNS servers, or other configuration parameters tailored for specific groups of devices.
How to access ipconfig:
Steps to access ipconfig on Windows
To access the ipconfig command on a Windows system:
- Press Windows + X or right-click the Start menu.
- Select Windows PowerShell or Command Prompt from the menu.
- In the Command Prompt or PowerShell window, type ipconfig and press Enter.
Steps to access ipconfig on Mac
To access the ipconfig command on a Mac:
- Press Command + Space to open spotlight search.
- Type Terminal and hit Enter to launch the Terminal application.
- In the Terminal window, type ipconfig and press Enter.
This command will display detailed information about your network interfaces, including IP addresses and other configuration details.
Risks of adversaries accessing ipconfig commands
Accessing the ipconfig command can reveal important network configuration details, so attackers gaining access to this information poses a serious threat to a networked environment.
- Network topology mapping: Adversaries can use the information from ipconfig to map out the network topology. This includes identifying active IP addresses, subnet masks, and gateways, which helps attackers understand the layout and structure of the network, making it easier to plan further attacks or lateral movements within the network.
- Targeted device attacks: If attackers obtain internal IP addresses through ipconfig, they can target specific devices within the network. This is particularly concerning if those devices have known vulnerabilities or if they are critical infrastructure components.
- DNS server exploitation: The command also reveals DNS server addresses. Knowledge of these servers allows attackers to potentially redirect traffic or conduct DNS spoofing attacks, leading users to malicious sites without their knowledge.
Given the potential risks associated with adversaries accessing ipconfig data, it's crucial to implement tools that provide real-time monitoring and alerting capabilities to safeguard your network.
How ManageEngine EventLog Analyzer helps in mitigating identity-based risks
ManageEngine EventLog Analyzer is a comprehensive log management solution that collects, monitors, correlates, and archives logs centrally from your network. It's a one-stop shop for you to troubleshoot errors, fortify your security posture, and help you stay compliant with regulatory mandates.
EventLog Analyzer collects logs from over 750 sources, including Windows event logs, which capture command executions and user activities. This allows for monitoring of all system commands executed, including ipconfig, thereby enabling the detection of suspicious activities.
It also provides real-time monitoring capabilities that can alert administrators to unusual command executions or patterns indicative of an attack. For instance, if multiple users attempt to access ipconfig commands in a short period, you may set up an alert for further investigation.
By correlating log data from various sources, EventLog Analyzer can identify patterns that suggest malicious intent. For example, if an ipconfig command is executed followed by a series of failed login attempts or access to sensitive files, this correlation can indicate a potential attack scenario.
What's next?










