Custom domain name resolution inside a Windows instance

Problem Description


A website cannot be accessed through a browser inside the Windows instance, but it can be accessed normally on other devices. The investigation found that the custom domain name resolution inside the Windows instance is inconsistent with the domain name resolution of the local network. The details are as follows:

1. The access in the Windows instance fails, as shown in the figure, but the website can be accessed normally using a local computer.

2. Log in to the Windows instance, and then execute the ping website domain name and nslookup website domain name commands in the command prompt inside the Windows instance, and find that the custom domain name resolution inside the Windows instance is inconsistent with the local network domain name resolution, as shown in the figure:

Problem Causes


The possible reasons for the inconsistency between the IP address resolved by the Windows instance and the local domain name are as follows:

• The DNS (Domain Name Server, DNS for short) resolution cache exists in the Windows operating system. At this point, you need to refresh the DNS resolution cache and access the website again.

• The configuration bound to this website already exists in the hosts file of the Windows operating system. At this point, you need to delete the configuration bound in the hosts file and access the website again.

• A PrivateZone record is configured for this domain name in a VPC-type Windows instance. In this case, you need to modify the relevant records of the Windows instance and then visit the website again.

Solution


Note This article uses Windows Server 2019 Data Center Edition 64-bit Chinese version operating system as an example. For other versions of Windows operating systems, you can refer to the steps in this article for modification.

Flush the DNS resolution cache

1. Remotely connect to the Windows instance.

2. Clear the DNS resolution cache in the Windows operating system.

a. Enter cmd in the search bar and click Command Prompt.

b. In the command prompt, run the ipconfig /flushdns command to clear the DNS resolution cache. Command to flush DNS

3. In the command prompt, execute the ping website domain name command to check whether the domain name resolution is normal.

As shown in the figure, domain name resolution returns to normal. Verify domain name resolution is back to normal

4. Go back to the website using your browser.

Delete the hosts file configuration

1. Remotely connect to the Windows instance.

2. Clear the configuration bound to the website in the hosts file of the Windows operating system.



If it exists, as shown in the figure, you need to delete the configuration and save the file. hosts file new

3. In the command prompt, execute the ping website domain name command to check whether the domain name resolution is normal.

As shown in the figure, domain name resolution returns to normal. Verify domain name resolution is back to normal

4. Go back to the website using your browser.

Modify PrivateZone records

1. Log in to the Alibaba Cloud DNS console.

2. In the left navigation bar, click PrivateZone.

3. On the PrivateZone page, click the Authoritative Zone tab.

4. In the PrivateZone list, click the ID of the target PrivateZone.

On the details page, view the associated VPC information, and check whether the information is consistent with the VPC information where the Windows instance resides. To view the VPC information of a Windows instance, see Viewing Instance Information. View VPC association information

If the associated VPC information is inconsistent with the VPC information of the Windows instance, you need to modify the VPC information on the Alibaba Cloud DNS console to the VPC information of the Windows instance, as follows:

a. In the PrivateZone list, click Associated VPC in the Action column of the target PrivateZone. Click Associate VPC

b. In the Associated VPC panel, add the VPC information where the Windows instance resides, and click OK. Associate VPC panel

5. In the PrivateZone list, click the name of the target PrivateZone.

On the resolution setting page, check the host resolution record information, and then check whether the configured resolution record information is consistent with the business usage. View parsing records

If the set resolution record information is inconsistent with the business usage, you need to modify the resolution record, as follows:

a. On the Resolution Settings page, click Modify in the Action column of the target record.

b. On the Modify Record page, modify the analysis record according to the actual situation, and then click OK. modification record

6. Go back to the website using your browser.

Important The PrivateZone record is automatically read and updated every minute in the Windows instance operating system, and you do not need to perform other operations.

Related Articles

Explore More Special Offers

  1. Short Message Service(SMS) & Mail Service

    50,000 email package starts as low as USD 1.99, 120 short messages start at only USD 1.00

phone Contact Us