Alibaba Cloud Public DNS Commercial Edition supports DNS resolution by using HTTP and HTTPS. To configure access to Alibaba Cloud Public DNS, perform the following steps to go to the Access Configuration page: Log on to the Alibaba Cloud DNS console and click Recursive Resolution (Public DNS) in the left-side navigation pane. On the Recursive Resolution (Public DNS) page, click the Access Configuration tab.
HTTP or HTTPS-based access methods
Method 1: Integrate Alibaba Cloud Public DNS SDK
Scenarios: This method is suitable for scenarios in which you want to prevent domain names of mobile apps and IoT devices from hijacking during resolution. Integrating Alibaba Cloud Public DNS SDK provides the same capabilities as integrating HTTPDNS.
Download Public DNS SDK for Android or Public DNS SDK for iOS based on the operating system of your app.
Integrate the SDK with your app. For more information, see the following topics:
Go to the Recursive Resolution (Public DNS) page in the Alibaba Cloud DNS console. On the Traffic Analysis tab, check whether the statistics about resolutions are displayed. If the statistics about resolutions are displayed, Alibaba Cloud Public DNS is successfully configured as your DNS service.
Method 2: Call the JSON API for DoH
Scenarios: This method is suitable for scenarios in which you cannot use SDKs and need to use native API operations to initiate DNS requests.
You can use the following URLs to call the JSON API for DNS over HTTPS (DoH). Both Transport Layer Security (TLS) and non-TLS API operations are provided.
https://dns.alidns.com/resolve?
https://alidns_ip/resolve?
http://dns.alidns.com/resolve?
http://alidns_ip/resolve?
For more information, see JSON API for DoH.
Method 3: Use DoT or DoH
Scenarios: This method is suitable for clients such as browsers and mobile phones. However, service authentication is not supported. We recommend that you do not use this method.
Configure the address of a DNS over TLS (DoT) or DoH server based on the corresponding format. Replace user_id with the value of the Account ID parameter that you can obtain from the Access Configuration tab of the Recursive Resolution (Public DNS) page in the Alibaba Cloud DNS console.
Address of a DoT server: user_id.alidns.com
Address of a DoH server: https://user_id.alidns.com/dns-query?
For more information about DoT, see DNS over TLS.
For more information about DoH, see Access Alibaba Cloud Public DNS by using DoH.
By default, DoT- or DoH-based access is disabled. You can manually enable DoT- or DoH-based access.
If DoT- or DoH-based access is disabled, DNS requests over DoT or DoH are rejected.
Service authentication is not supported if you use Alibaba Cloud Public DNS for DNS resolution over DoH or DoT. In this case, unauthorized users may perform DNS resolution by using your account. Make sure that you keep your account ID confidential.