Why ping domain name get IP and actual public network IP does not match

Source: Internet
Author: User
Tags get ip valid

The 1.ping command returns a public network IP address, but this IP address is inconsistent with the current public network IP of the machine where the peanut shell client is located

For example Ping ping-is-no-good.gicp.net, the IP returned is 59.37.71.85, as shown in the following figure:

And the current peanut shell log in computer through the router Internet, the router's WAN IP is 121.32.186.189, that is, peanut shell log in this computer's public network IP is 121.32.186.189.

① encountered this situation, first of all to verify that the DNS cache on your computer has not been refreshed.

Imagine an example of this: you just opened the browser in computer C to access the domain name Ping-is-no-good.gicp.net, found that the browser prompts "you entered the domain name and Web address can not access", then C's DNS cache left a record of the IP address of this domain name. You checked the server S, peanut shell found the client offline, and then you put the peanut shell client back online, then you go to the computer C to access the domain name, it is likely at this time the DNS cache will return to your previous IP address, rather than the current public network IP address S.

The following is a specific process:

Use the command "Ipconfig/displaydns" to see all the records in the native DNS cache. A record of the ping-is-no-good.gicp.net is found in the following illustration:

When a computer pings a domain name, it goes to the local DNS cache, and the information in the DNS cache that you see affects the result of the ping.

You can then use the command "Ipconfig/flushdns" to clear all records in the native DNS cache, as shown in the following illustration:

After the cache is cleared and the domain name is ping, the effect of the native DNS cache can be excluded, and the IP address returned is correct, as shown in the following illustration:

② Sometimes you'll find that after you clear the DNS cache for this computer, the IP that ping domain name gets is still not the correct IP address. It's probably your broadband provider's area. The DNS server has not yet refreshed the data, which means it has not synchronized DNS data, so when the IP address of the computer on your peanut shell changes, Although the Oray DNS server has pointed the ping-is-no-good.gicp.net to the current new IP address, the DNS server of your provider in that area returns to your computer's ping-is-no-good.gicp.net IP address or previous IP address. As shown in the following illustration:

All you have to do is set up your native DNS server to be the most efficient DNS server on the ground, and you can call your broadband provider's service phone and ask for an efficient DNS address to your computer. For example, change the computer's primary DNS from 202.96.128.86 to 202.96.128.166, and then ping the native DNS cache with the command "Ipconfig/flushdns" Ping-is-no-good.gicp.net, the results are correct, as shown in the following illustration:

2. Ping command returns a LAN IP address

As shown in the following illustration:

192.168.0.2 is a LAN IP address that is not valid on the public web.

The reason for this is that the user has added an IP address record about ping-is-no-good.gicp.net in the hosts file of this machine.

Hosts file is a file for storing node information in computer network, it can map host name to corresponding IP address, realize DNS function, it can be controlled by the user of computer. The Hosts file is only valid for this machine.

Hosts files are stored in different operating systems, and even different versions of Windows are not the same location. Windows Nt/2000/xp/2003/vista: The default location is%systemroot%system32driversetc. such as C:WINDOWSSYSTEM32DRIVERSETC.

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.