After you add a domain name in the DCDN console, test your configuration before updating its DNS record to ensure a seamless transition and prevent service disruptions. This topic describes how to validate your configuration by using a local hosts file.
This testing procedure simulates normal DCDN access and incurs charges. You are charged for the DCDN basic service and any value-added services used during the test. The billing method is the same as for regular DCDN usage. For more information, see Billing overview.
Prerequisites
You have successfully added a domain name. If not, see Add a domain name.
The origin server configured on the Domain Names page must be accessible.
Procedure
Get the domain CNAME
Log on to the DCDN console.
In the left-side navigation pane, click Domain Names.
On the Domain Names page, copy the CNAME that corresponds to your domain name.
NoteCopy the CNAME of a domain name that is in the Normal state.
Get the IP address for the CNAME
NoteThe IP address returned by the ping command is for reference only. The actual IP address is the one that is returned when you ping your actual CNAME.
On Windows: Open a Command Prompt window. In the command line, ping the CNAME to obtain the IP address from the ping.
On macOS: Open a Terminal window and run the dig command on the CNAME to obtain the IP address from the dig output.
Modify the local hosts file
Add an entry to your local hosts file that maps the IP address from Step 2 to your domain name. The entry must use the format
IP address domain name, and the order is important.For example, if your domain name is
example.com, its CNAME isexample.com.w.kunlunsl.com, and pinging the CNAME returns the IP address192.168.0.1, add a mapping as shown in the following steps.For Windows systems, the file path is C:\Windows\System32\drivers\etc\hosts. The following figure shows an example of a successful binding.
On macOS, the file path is Finder > Go > Go to Folder > /etc/hosts. The figure below shows an example of a successful binding.
Test domain accessibility
After modifying the hosts file, open the domain name in a browser on your computer. Use your browser's developer tools to check the result.
If the IP address shown after Remote Address matches the IP address that you added to the hosts file, your configuration is correct. You can now configure the CNAME with your DNS service provider.
If the IP address shown after Remote Address does not match the IP address in your hosts file, the configuration is incorrect. Verify that the IP address in the hosts file is correct and matches the IP address for the CNAME.
Once you can access the domain name, you can perform other validation tests as needed.