This topic explains how to activate and utilize HTTPDNS.
Overview
If your mobile app relies on the domain name www.example.com
for service delivery, users may encounter issues such as redirection to incorrect websites, stuttering, or disconnections due to domain hijacking or inaccurate scheduling. To address these issues, integrate the HTTPDNS client SDK into your app. This document describes the steps to:
Activate the HTTPDNS service.
Register the domain name requiring resolution.
Test the resolution effectiveness using the HTTP API.
Compile and execute the provided Android and iOS sample projects to facilitate quick integration and verification of the solution.
Step 1: Service activation
Log on to the EMAS console.
Choose the appropriate legal resources and click Submit.
The EMAS service is now active.
Skip this step if the EMAS service is already active.
Step 2: Add domain name
To use HTTPDNS for DNS resolution of a domain name, you must first add the domain to HTTPDNS. Without this step, HTTPDNS cannot resolve the domain and its subdomains. Follow these instructions to add a domain name:
Log on to the EMAS console.
In the left-side navigation pane, select Domain Management.
Click Add Domain Name, enter the required domain, and click OK.
You have now successfully added the domain name for resolution. Next, we will verify the resolution's effectiveness.
Step 3: Verify results
To quickly verify the newly added domain, enter the test URL into your browser:
https://161.117.200.122/${accountId}/d?host=${host}
Replace ${accountId} and ${host} with the actual values from your console.
accountId is available in developer configuration, for example, 334455.
The final URL should look like: https://161.117.200.122/334455/d?host=www.aliyun.com
A successful resolution will return one or more IP addresses from the HTTPDNS server.
[
{
"host":"www.aliyun.com",
"ips":[
"192.X.X.1",
"192.X.X.2"
],
"ttl": 596,
"origin_ttl": 600,
"client_ip":"192.168.XX.XX",
},
]
If the response is as follows, you may need to add the domain name to the domain list.
{
"host": "www.example.com",
"ips": [],
"ttl": 300,
"client_ip": "140.X.X.236"
}
For integrating the HTTPDNS feature into your mobile app, we recommend using our SDK. Refer to the following documents for client SDK integration methods: