Binding a domain name with a host

Last Updated: Jul 03, 2017

You can bind a host with a domain name to specify an IP address on your PC without modifying DNS resolution, and then compare the effects between accelerated access and non-accelerated access, which helps troubleshooting a lot.

Open the hosts file in C:\Windows\System32\drivers\etc, and enter the IP address, a space, and then your domain name. Then ping the domain name www.test.com on the PC. The IP address to which the DNS points is 1.1.1.1. (In Windows DNS, the system first obtains the corresponding IP address from the hosts file. If the IP address cannot be found, the system submits the web address to the DNS server for IP address resolution.)

hosts

Take www.test.com where the Alibaba Cloud CDN(CDN) is deployed as an example. If an error is returned when you access www.test.com but you have trouble in modifying the DNS, you can modify the hosts file in your PC. If the IP address of the origin site server is 112.112.112.12, add 112.112.112.12 www.test.com to the hosts file. Then, after you clear the browser cache records and restart the browser, you can obtain data directly from the IP address 112.112.112.12, without acceleration of the Alibaba Cloud CDN(CDN) node.

If an access error occurs after the host IP address is changed to the IP address of the origin site server, the fault lies on the origin site but not the Alibaba Cloud CDN(CDN).

If the access is normal after the host IP address is changed to the IP address of the origin site server but the Alibaba Cloud CDN(CDN) domain cannot be accessed, you can compare these two links. If parameter filtering is enabled on the Alibaba Cloud CDN(CDN), the parameters behind the question mark “?” will be filtered. For example, when accessing www.test.com, you actually access www.test.com/?*=. If parameter filtering is enabled on the Alibaba Cloud CDN(CDN), ?*= in the Alibaba Cloud CDN(CDN) domain will be deleted. In this case, just disable parameter filtering.

Of course, in other scenarios such as SLB, you can also bind the domain name with the host to troubleshoot the fault.

If the problem persists, contact after-sales technical support.

Thank you! We've received your feedback.