Recently, a server was installed on the ADSL Network of Tianjin Netcom. To get the IP address, I used the DNS query command and found several interesting problems:
1. Sometimes several interesting IP addresses 218.68.250.117, 218.68.250.118, and 218.68.250.119 are returned,
2. The time is concentrated in the period from to. other time periods have not appeared, or rarely appear.
After my simple analysis, it is estimated that there is a reason. You are welcome to discuss it:
Question 1: these three IP addresses are incorrect IP addresses of the Tianjin Netcom domain name. Instead of returning an error, they return the address of a page with a domain name error. In this way, when an error occurs during access, the page is displayed, to make money, the so-called DNS binding.
So when you handle DNS errors, if you do not return an IP address as an error, you still need to consider this situation. you can ping a non-existent domain name at will and return the above IP addresses (provided that you use the network of Tianjin Netcom)
Question 2: I don't know what's going on. I used the gethostbyname function to query the IP address of the domain name, which was queried every 20 s. I thought that the DNS refused the request because of frequent queries, but it does not look like this, because the time is concentrated between and. In other cases, I useProgramTests, while loop tests without pauses, and no problems have occurred. The analysis is correct all the time. Do you have any comments to discuss.