Troubleshooting Slow Access of a Website Outside the Chinese Mainland over an ECS
Accessing a website outside the Chinese Mainland may be slow on an ECS. This is caused by the slow access of a DNS server outside the Chinese Mainland.
If you are required to access websites outside the Chinese Mainland, purchase an ECS in a region outside the Chinese Mainland. To do so, select the target region when purchasing the ECS.
You are advised to perform the operations described in this section to identify the cause of slow website access outside the Chinese Mainland. The following uses a Windows ECS as an example to describe how to troubleshoot slow access to www.example.com.
- Checking Whether DNS Has Been Correctly Configured
- Checking Whether the Request Is Responded
- Modifying the hosts File to Speed Up the Website Access
Checking Whether DNS Has Been Correctly Configured
- Run cmd and then ipconfig /all to check whether a default HUAWEI CLOUD DNS server address is used.You are advised to use the default HUAWEI CLOUD DNS server addresses.
To obtain the addresses, see What Are the Private DNS Server Addresses Provided by the DNS Service?
- Run the following command to check whether your ECS and the DNS server are reachable to each other:
Taking the CN North-Beijing 1 region as an example, run the ping 100.125.1.250 command.
- Run the following command to check whether domain name resolution is functional:
For example, run nslookup www.example.com.
Access the target website again and check whether the fault has been rectified.
If the fault persists, perform the following operations to continue the fault locating.
Checking Whether the Request Is Responded
curl -I Target website
For example, run curl -I www.example.com.
Try to access the target website. If the website can be accessed but the loading is slow, packet loss may occur when you access the destination server. In such a case, run the ping -t Website address command to check the packet loss. For details, see Troubleshooting a Ping Failure or Packet Loss Using a Link Test.
For example, run ping -t www.example.com.
In Windows, you can also download the curl client, decompress it, open the bin folder, copy the path, and configure the environment variables.
If a response status code is displayed, the request has been sent and received. The slow website access may be caused by loss of packets sent to the destination server.
Contact customer service to check for packet loss.
Modifying the hosts File to Speed Up the Website Access
You can also try to speed up the website access by modifying the hosts file. To do so, perform the following operations:
- Log in to the ECS as user Administrator.
- Use a browser to access the ping check tool. The following uses http://ping.chinaz.com as an example.
- Ping the target website for test. Take www.example.com as an example. Record the IP address with the lowest response time in detection results.
- Download PingInfoView, decompress it, and run PingInfoView.exe.
- Open PingInfoView, copy the IP addresses obtained in step 3 to the text box, and click OK.
- Copy the IP address with the lowest response time in the search result.
- Open the C:\Windows\System32\drivers\etc\ hosts file and paste the IP address in the end of the file.
The hosts file is one of the core OS files. Therefore, exercise caution when modifying it.
You are advised to back up the hosts file using either of the following methods: Copy and paste the hosts file for file backup; copy and paste the data of the hosts file for content backup.
For example, if the selected IP address is 184.108.40.206, enter 220.127.116.11 www.example.com in the end of the hosts file, save and exit the file.
- Access the target website again.