Help Center> Huawei Cloud Flexus> FAQs> Network Configurations> Why Accessing a Website Outside the Chinese Mainland Is Slow on an HECS?

Why Accessing a Website Outside the Chinese Mainland Is Slow on an HECS?

Symptom

Accessing a website outside the Chinese mainland may be slow on an HECS.

Generally, an international line is used for accessing a website outside the Chinese mainland. However, the international line may inevitably pass through network nodes distributed around the world, resulting in high latency.

Handling Methods

  • Purchase HECSs in a region outside the Chinese mainland.

    Considering the physical distance and network infrastructure, you can purchase HECSs in a region outside the Chinese mainland if you need to access websites outside the Chinese mainland.

    The following uses AP-Hong Kong as an example.

    Figure 1 Buying HECSs in AP-Hong Kong

Modifying the DNS Configuration

Change the DNS server addresses to public DNS server addresses, for example, 114.114.114.114 and 8.8.8.8.

Figure 2 demonstrates how you can modify the DNS configuration on Windows Server 2012.

Figure 2 Modifying the DNS configuration

The following are detailed operations:

  1. Log in to the HECS as user Administrator.
  2. Enable the local area connection.
    1. In the lower right corner of the taskbar, right-click the network connection icon.
    2. Click Open Network and Sharing Center.
      Figure 3 Open Network and Sharing Center
    3. In the navigation pane on the left, click Change adapter settings.
  3. Configure the DNS server addresses of the HECS.
    1. Double-click network connections.
    2. Click Properties in the lower left corner.
      Figure 4 Local area connection
    3. Select Internet Protocol Version 4 (TCP/IPv4) and click Properties.
      Figure 5 Selecting a protocol type
    4. Select Use the following DNS server addresses and set the DNS server addresses.
      Figure 6 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:

Method 1: Pinging the Domain Name

Figure 7 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.)

Figure 7 Modifying the hosts file

The following are detailed operations:

  1. Ping www.example.com and wait for the result.
    Figure 8 Command output
  2. Ping the domain name repeatedly and record a stable IP address with the smallest TTL value.

    During the operation, run the ipconfig /flushdns command to refresh the DNS resolution cache. If you do not run the command, the same IP address will be returned.

    In this example, IP address 93.184.216.34 has the smallest TTL value (TTL=44).

  3. Modify the hosts file.

    Open the C:\Windows\System32\drivers\etc\hosts file, add the mapping between the IP address and the domain name (99.84.178.238 www.example.com) in the end of the file, save and exit the file.

    • The hosts file is one of core OS files. Back up the hosts file before modifying it.
    • 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 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.
  4. Access the website again.

    Modifying the hosts file can only improve the access speed. If the problem persists, purchase HECSs in a region outside the Chinese mainland, for example, AP-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:

  1. Log in to the HECS as user Administrator.
  2. Use a browser to access the ping tool.
  3. 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.)
  4. Download PingInfoView, decompress it, and run PingInfoView.exe.
  5. Open PingInfoView, copy the IP addresses obtained in step 3 to the text box, and click OK.

  6. Copy one IP address in the search result.

  7. 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.
    • The hosts file is one of core OS files. Back up the hosts file before modifying it.
    • 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 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.

  8. Access the website again.

    If the fault persists, use an HECS purchased in a region outside the Chinese mainland to access the website.

Checking Whether the Request Is Responded

Try to access the website. If the website can be accessed but it is loaded slowly, packet loss may occur. 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.

Example command: 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. You can also use Cloud Connect to speed up website access. For details, see Communication Among Multiple VPCs Across Regions.