Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use commands to fix network problems on Windows 10

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly shows you "how to use commands to fix network problems on Windows 10". The content is simple and clear. I hope it can help you solve your doubts. Let me lead you to study and learn this article "how to use commands to fix network problems on Windows 10".

1. IPConfig

Ipconfig (Internet Protocol configuration) is one of the most commonly used networking tools that allows you to query and display the 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.

A. Show network configuration

1. Search the taskbar search box for the Command prompt, and then select the run as administrator option.

two。 Type the following command to view a summary of the TCP/IP network configuration, and then press Enter.

Ipconfig

3. Type the following command to view all TCP / IP network configurations, and then press Enter.

Ipconfig / all

After completing these steps, you will get an overview of PC's entire TCP / IP configuration.

B. Refresh network settings

1. Search the taskbar search box for the Command prompt, and then select the run as administrator option.

two。 Enter the following command to delete the current network configuration, and then press Enter:

Ipconfig / release

3. Reconfigure the network configuration by typing the following command, and then press Enter:

Ipconfig / renew

After completing these steps, the first command clears the current configuration, and the second command fetches the new settings from the DHCP server to resolve the connection problem. If the dynamically assigned settings in the server have not expired, you will usually see the same IP address reconfiguration on the device.

C, refresh DNS settings

To refresh and rebuild the current DNS cache entry on Windows 10, use the following steps:

1. Search the taskbar search box for the Command prompt, and then select the run as administrator option.

two。 Clear the DNS system cache on the device by typing the following command, and then press Enter:

Ipconfig / flushdns

After these steps are completed, the entries stored in the DNS cache of Windows 10 are deleted and flushed. Typically, this command comes in handy when you cannot connect to another computer or Web site using a hostname or domain name because the information in the local cache is outdated.

2. Ping

Ping is another important networking tool that allows you to send ICMP (Internet Control message Protocol) echo request messages to test IP connections to other devices, whether it's another computer in the network or an Internet service.

A. Test equipment connection

1. Search the taskbar search box for the Command prompt, and then select the run as administrator option.

two。 Type the following command to send an ICMP echo request to test connectivity, and then 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, the following command tests communication between the local device and the router:

Ping 10.1.4.1

Tip: if you use this-an option (for example, ping-a 10.1.4.1), the command also resolves the address to the hostname.

3. (optional) Test the local computer network stack by typing the following command, and then press Enter:

Ping 127.0.0.1 or ping loopback

Description: 127.0.0.1 is a well-known address, which is called the loopback address. When you run the command, if you receive a reply, the network stack on Windows 10 is up and running. This is the same as using its own network address ping device.

After completing these steps, if you receive four successful echo replies from the target, the device can communicate with the remote host. If the request times out, there may be problems caused by many reasons.

If you want to resolve the connection problem, start pinning the local computer to ensure that the network stack is working properly. Then test the connection to the router to ensure that the problem is not on the local network. Then try ping the Web site to see if there is a problem with the Internet connection or the remote host.

It should also be noted that if the remote device or service blocks the ICMP protocol, the ping command will always time out.

B. Diagnosing packet loss activities

The ping command includes a number of command options, one of which is that you can set the time to run the tool and easily check for lost packets while troubleshooting connection problems.

To run the ping command for a specific period of time, use the following steps:

1. Search the taskbar search box for the Command prompt, and then select the run as administrator option.

two。 Enter the following command to start ping until it stops, and then 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, the following command tests the communication between the local device and the router for 60 seconds:

Ping 10.1.4.1-t

3. Use the Control + C keyboard shortcut to stop ping.

After completing these steps, you will be able to see successful and lost requests that can provide you with clues on how to proceed with troubleshooting and resolving connection problems. On the local network, administrators usually use the ping command to find out when the service shuts down quickly. In addition, the tool can be used as a way to quickly know when the server is started and run again when the server is restarted remotely.

3. Tracert

Tracert (tracking routes) is a diagnostic tool that uses a series of ICMP echo requests to determine the network to the destination.

Tracert google.com

The path. However, unlike the ping command, each request contains a TTL (time to live) value, which is incremented by 1 at a time, which displays a list of routes and durations that the request has traveled.

To track the route to the destination using the command prompt, use the following steps:

1. Search the taskbar search box for the Command prompt, and then select the run as administrator option.

two。 Enter the following command to learn the path to the destination, and then press Enter:

Tracert IP-OR-DOMAIN

In the command, replace IP-OR-DOMAIN with the actual IP address or domain name of the target you want to troubleshoot.

For example, the following command allows you to view the path that packets take to reach Google.com:

Tracert google.com

3. (optional) adjust the hop count to target by typing the following command, and then press Enter:

Tracert-h HOP-COUNT IP-OR-DOMAIN

In the command, replace IP-OR-DOMAIN with the actual IP address or domain name of the target you want to troubleshoot, and replace HOP-COUNT with the number of hops to track.

For example, the following command limits the target to 5 hops (nodes):

Tracert-h 5 google.com

4. NSLookup

The NSLOOKUP (name server lookup) tool can display valuable information to troubleshoot and resolve DNS-related problems. The tool includes both interactive and non-interactive modes. However, you will use more non-interactive mode, which only means that you will type the full command to get the information you need.

You can use this command to display the default DNS name and address of the local device and to determine the domain name of the IP address or the name server of a specific node.

1. Run as administrator command prompt.

two。 Type the following command to find the local DNS name and address, and then press Enter:

Nslookup

Description: this command can also turn on nslookup interactive mode.

3. Confirm the current DNS information.

4. Enter the following command to exit interactive mode, and then press Enter:

Exit

5. Type the following command to determine the name and address of a specific server, and then press Enter:

Nslookup IP-ADDRESS

In the command, replace IP-ADDRESS with the address of the remote device.

For example, this command looks for the IP address 172.217.165.142:

Nslookup 172.217.165.142

6. Type the following command to determine the address of a specific server, and then press Enter:

Nslookup DOMAIN-NAME

In the command, replace 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 completing these steps, according to the command, you will know whether the device has an DNS parser and the IP address or domain of the remote host, and vice versa.

5. NetStat

Netstat's (Network Statistics) tool displays statistics for all network connections, which enables you to learn about open and connected ports to monitor and troubleshoot network problems with Windows 10 and applications.

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 so on.

1. Run as administrator command prompt.

two。 Enter the following command to display all active TCP connections, and then press Enter:

Netstat

3. (optional) instead of trying to determine the name, type the following command to display the active connection that displays the numeric IP address and port number, and then press Enter:

Netstat-n

4. "optionally, type the following command to refresh the information at specific intervals, and then press Enter:"

Netstat-n INTERVAL

In the command, be sure to replace INTERVAL with the number (in seconds) for which you want to redisplay the information.

This example refreshes the problematic command every five seconds:

Netstat-n 5

Description: when using the interval parameter, you can use the Ctrl + C keyboard shortcut in the console to terminate the command.

6. ARP

Windows 10 maintains an arp (address Resolution Protocol) table that stores IP to media access control (MAC) entries that have been resolved by the system. Using the arp tool, you can view the entire table, modify entries, and use it to determine the MAC address of the remote computer.

In general, you don't have to worry about MAC addresses, but in some cases this information may come in handy. For example, when troubleshooting (switching) network problems at the data link layer, or when restricting access through the network or filtering content through specific devices.

1. Run as administrator command prompt.

two。 Type the following command to view the current arp table cache on Windows 10, and then press the Enter key:

Arp-a

3. Determine the MAC address of the remote device by typing the following command, and then press Enter:

Arp-an IP

In the command, be sure to replace IP with the destination address.

For example, the following command shows the physical address of the 10.1.4.113 target:

Arp-a 10.1.4.108

4. Confirm the MAC (physical) address of the remote device.

After completing these steps, you will be able to view the entire arp table and the MAC address of a specific IP address.

7.Route

The Route tool displays the routing table, allowing Windows 10 to learn about the network and communicate with other devices and services. The tool also provides options to modify and clear tables as needed.

1. Run as administrator command prompt.

two。 Type the following command to view the routing table known to Windows 10, and then press Enter:

Route print

3. Confirm the routing table information.

4. (optional) clear the routing table by typing the following command, and then press Enter:

Route-f

Description: when you run this command, the device will lose its network connection because the system no longer knows about the network topology. After running the command, restart the computer to allow the network stack to rebuild the routing table. In general, you do not have to clear the table unless some entries have been modified and the table needs to be reset.

8. Netsh

On Windows 10, netsh (Network Shell) is an older command-line tool that allows you to display and change almost any network configuration. For example, you can use this tool to view the current network configuration, manage wireless connections, reset the network stack to fix the most common problems, enable or disable firewalls, and so on.

1. Run as administrator command prompt.

two。 Type the following command to view a list of available commands, and then press Enter:

Netsh /?

3. Type the following command to view a list of available subcommands (subcontexts) for a specific option, and then press Enter:

Netsh CONTEXT-COMMAND

In the command, change the CONTEXT-COMMAND of the command that contains other options.

For example, the following command shows the commands that can be used to manage firewalls using netsh:

Netsh advfirewall /?

After completing these steps, you will know how to browse the netsh contexts and subcontexts commands to manage network settings.

A, reset the system network stack

To reset the network stack to resolve common connectivity problems, use the following steps:

1. Run as administrator command prompt.

two。 Reset the winsock stack by typing the following command, and then press Enter:

Netsh winsock reset

3. Restart the computer.

B, export and import network configuration

To export the network configuration on Windows 10 using netsh, use the following steps:

1. Run as administrator command prompt.

two。 Export the current configuration of all network adapters by typing the following command, and then press Enter:

Netsh-c interface dump > PATH\ TO\ EXPORTED.txt

In the command, replace PATH\ TO\ EXPORTED.txt with the path and name of the file where the configuration is stored.

For example, the following command exports settings to a netshconfig.txt file:

Netsh-c interface dump > c:\ netshconfig.txt

After completing these steps, you can use any text editor to open the file to view the exported configuration.

C. Import network configuration

1. Run as administrator command prompt.

two。 Enter the following command to import the network configuration, and then press Enter:

Netsh-c interface dump > PATH\ TO\ IMPORTED.txt

In the command, replace PATH\ TO\ EXPORTED.txt with the path and name of the desired file with the exported configuration.

For example, the following command imports settings from a netshconfig.txt file:

Netsh-f c:\ netshconfig.txt

After completing these steps, the new network configuration will be imported and applied to Windows 10.

D, enable and disable firewalls

1. Run as administrator command prompt.

two。 Enable the default firewall by typing the following command, and then press Enter:

Netsh advfirewall set currentprofile state on

3. Enter the following command to disable the default firewall, and then press Enter:

Netsh advfirewall set currentprofile state off above is all the contents of the article "how to use commands to fix network problems on Windows 10". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report