Use the ping command to easily troubleshoot network problems

Source: Internet
Author: User

ping command Use Tips

One, ". 0" can be omitted conditionally

We often use the "ping 127.0.0.1" command on this machine to do loop testing, to verify that the local TCP/IP protocol cluster is installed correctly. Win7 system download but did you find out? Using the "Ping 127.1" command can also get the same test results (see figure), in fact, "Ping 127.1" and "ping 127.0.0.1" The two commands are the same, are in the loop test.

Why is this so? This is the use of IP addresses in the ping command app. As we all know, the IP address consists of 32-bit binary numbers, in order to facilitate the memory of each 8-bit binary numbers converted into decimal numbers, thus forming an easy to remember the four-part decimal number of the IP address (such as 127.0.0.1). Because the Windows operating system has auto-populated ". 0" functionality, I can change "127.0.0.1" to "127.1".

However, the omission of this ". 0" is conditional and cannot be omitted arbitrarily. In the application of the ping command, you can only omit one or more ". 0" occurrences before the last decimal digit of the IP address, such as the "ping 127.0.0.1" command being rewritten as "ping 127.1".

If this one or more ". 0" does not precede the last part of the decimal number, but in other locations, then this ". 0" can not be omitted, the latest windows7 system such as "ping 202.0.96.1" can not be written as "Ping 202.96.1". This is because "ping 202.96.1" returns the result of "202.96.0.1" instead of the "202.0.96.1" reply message.

Second, the number string instead of the IP address

In the ping command, you can also use a number string instead of an IP address, do you believe it? Run the "Ping 3658906394" command and you will see the "218.22.123.26" return information for this IP address. Why is that? In fact, "3658906394" is another representation of the IP address "218.22.123.26". Of course, you can ping other IP addresses in the same way.

How is the string converted? In fact, the "218.22.123.26" IP address as an example, the IP address into a digital string method is as follows: First convert "218.22.123.26" to Hex "da.16.7b.1a", then remove the decimal point, and then change to " Da167b1a ", finally converting this hexadecimal number to decimal" 3658906394 ", then" 218.22.123.26 "becomes" 3658906394 ". Other IP addresses are converted to digital strings using the same method.

Tip: In some LAN environments, using the "ping+ string" command may fail with the prompt message "Unknown host string" because the string is parsed as a hostname instead of an IP address. Therefore, after mastering the above skills, network management in testing or maintenance, can skillfully use the "ellipsis" method, reduce the ping command character input, improve work efficiency. Xiamen SEO at the same time, the use of digital strings instead of IP addresses can also confuse curious ordinary users, lest they randomly set.

Determine network failures with several ping commands

LAN computer can not be connected to the Internet can be divided into the following reasons, the system's IP settings, network cards, router gateways and line failure. To troubleshoot problems with hardware and wiring, we can use the ping command to quickly detect network conditions.

First, we click on the system in the beginning of the run, enter the cmd command in the Run bar, the operating system DOS window will pop up, here we can be intuitive and convenient to enter a variety of DOS commands. Next, we can enter ping 127.0.0.1 in DOS, the address is a local loop address, if found this address can not ping, it indicates that the local machine TCP/IP protocol does not work properly, you should check the native operating system installation settings.

If the above operation is successful and can be ping, we can then enter Ipconfig to view the local IP address, and then ping the IP (such as 192.168.0.100), the general rule indicates that the network adapter (NIC or modem) is working properly, the network adapter fails , you can try to replace the network card or driver. And then ping a network segment of the computer's IP, the general rule indicates that there is a failure of the Internet line, if the network also contains a router, you should first ping the router in the network segment port IP, not the general section of this line has a problem, should check the network switch or network cable failure.

If the intranet computer can ping the general of the Router (gateway), (such as 192.168.0.1), if not, then the router is faulty, can replace the network cable connected to the router, or use a network cable to connect the PC directly to the router, if you can ping through, You should check the router to switch network cable failure, such as unable to ping, you can try to replace the computer and ping, if you can not ping, you should check the router failure.

Finally, if the router is normal, you can re-detect a network with the DNS service, after the previous step ping the destination computer's IP address, still cannot connect to the machine, you can ping the machine's network name, such as Ping www.sina.com.cn, the IP that the URL points to is normally present, which indicates that the DNS settings are correct and that the DNS server is functioning properly, and that one of them may have failed, or the failure of WINS resolution can be detected by pinging the computer name ( WINS is the service that resolves the computer name to an IP address.

If the above ping test is not a problem, then we think the network is normal, if there is an application can not be properly connected, such as Web page cannot open, you should check the corresponding DNS server reasons, such as QQ, a game and other applications can not surf the Internet, you should check the corresponding program, or its server failure.

When the above steps have been completed, we can easily determine the end of a certain part of the problem, the reset settings, the hardware changer hardware. In addition, if you want to detect the network connection, we can also add-t after the ping address, so that can be continuously ping connection, can reflect the network connection whether there is an interruption or packet loss phenomenon occurs.

Ping command is a very useful command, when you encounter a network failure, you can first ping the host, this is the most common and most practical test method, because the error is often out here, and it can also explain a lot of problems, you can be targeted for troubleshooting.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.