Why Accessing a Website Outside the Chinese Mainland Is Slow on an ECS?
Symptom
Websites outside the Chinese mainland, including those in Hong Kong (China), Macao (China), Taiwan (China), and other countries and regions, may be slow to access.
Generally, an international line is used for accessing websites outside the Chinese mainland. However, the international line may inevitably pass through network nodes distributed around the world, resulting in high latency.
Solutions
- Purchase an ECS in a region (such as CN-Hong Kong) outside the Chinese mainland.
Considering the physical distance and network infrastructure, you can purchase an ECS in a region outside the Chinese mainland if you need to access websites outside the Chinese mainland.
For example, select the CN-Hong Kong region during the ECS purchase.
- Improve the access speed.
Alternatively, perform the following operations to speed up the access.
After that, run the ping -t Website address command to check the packet loss. For details, see Checking Whether the Request Is Responded.
Modifying the DNS Configuration
Change the DNS server addresses to public DNS server addresses, for example, 101.226.4.6 and 1.1.1.1.
The following figure demonstrates how you can modify the DNS configuration on Windows Server 2012.
The following are detailed operations:
- Log in to the Windows ECS as user Administrator.
- Enable the local area connection.
- In the lower right corner of the taskbar, right-click the network connection icon.
- Click Open Network and Sharing Center.
Figure 2 Open Network and Sharing Center
- In the navigation pane on the left, click Change adapter settings.
- Configure the DNS server for the ECS.
- Double-click network connections.
- Click Properties in the lower left corner.
Figure 3 Local area connection
- Select Internet Protocol Version 4 (TCP/IPv4) and click Properties.
Figure 4 Selecting a protocol type
- Select Use the following DNS server addresses and set the IP addresses of the DNS servers as prompted.
Figure 5 Setting the DNS server addresses
Modifying the hosts File
Select a server that allows you to access the website at the fastest speed and add its IP address and the domain name of the website to the hosts file.
Use either of the following methods to obtain the IP address of the server that allows you to access the website at the fastest speed:
- Ping the domain name.
For details, see Method 1: Pinging the Domain Name.
- Use a ping tool and PingInfoView.
For details, see Method 2: Using a Ping Tool and PingInfoView.
Method 1: Pinging the Domain Name
The following figure demonstrates how you can ping the domain name on Windows Server 2012 to obtain the IP address of the server with the fastest access speed. (www.example.com is used as the example domain name.)
The following are detailed operations:
- Ping www.example.com and wait for the result.
Figure 7 Command output
- Ping the domain name repeatedly and record a stable IP address with the smallest TTL value.
During the ping operation, run the ipconfig /flushdns command to refresh the DNS resolution cache. Otherwise, the same IP address will be pinged continuously.
In this example, IP address 93.184.216.34 has the smallest TTL value.
- Modify the hosts file.
Open the C:\Windows\System32\drivers\etc\hosts file and add the mapping between the IP address and the domain name in the end of the file.
For example, if the obtained IP address is 93.184.216.34, enter 93.184.216.34 www.example.com in the end of the hosts file, save and exit the file.
- Exercise caution when you modify the hosts file.
You are advised to back up the hosts file using either of the following methods: Copy and paste the hosts file, or copy and paste the content of the hosts file.
- Only the IP address you have configured in the hosts file will be returned when the domain name is used to access the website.
- If access is still slow and you want to replace the IP address, delete the existing mapping from the hosts file and repeat the proceeding operations to obtain a new IP address.
- Exercise caution when you modify the hosts file.
- Access the website again.
Modifying the hosts file can only speed up the website access. If the problem persists, purchase an ECS in a region outside the Chinese Mainland, for example, CN-Hong Kong.
Method 2: Using a Ping Tool and PingInfoView
You can also try to speed up website access by modifying the hosts file. To do so, perform the following operations:
- Log in to your ECS as user Administrator.
- Use a browser to access the ping tool.
- Enter the domain name of the website and record the IP addresses with the lowest response time. (www.example.com is used as an example.)
- 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 one IP address in the search result.
- Open the C:\Windows\System32\drivers\etc\hosts file and add the mapping between the IP address and the domain name in the end of the file.
- Exercise caution when you modify the hosts file.
You are advised to back up the hosts file using either of the following methods: Copy and paste the hosts file, or copy and paste the content of the hosts file.
- Only the IP address you have configured in the hosts file will be returned when the domain name is used to access the website.
- If access is still slow and you want to replace the IP address, delete the existing mapping from the hosts file and repeat the proceeding operations to obtain a new IP address.
For example, if the obtained IP address is 99.84.178.238, enter 99.84.178.238 www.example.com in the end of the hosts file, save and exit the file.
- Exercise caution when you modify the hosts file.
- Access the website again.
If the fault persists, use an ECS purchased in a region outside the Chinese Mainland to access the target website.
Checking Whether the Request Is Responded
Try to access the target website. If the website can be accessed but the loading is still slow, packet loss may occur. In such a case, run the ping -t Website address command to check the packet loss. For details, see How Do I Troubleshoot 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. Slow website access may be caused by loss of packets sent to the destination server.
Contact customer service to check for packet loss.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.