All Products
Search
Document Center

HTTPDNS:Use the service

Last Updated:Feb 17, 2025

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:

  1. Activate the HTTPDNS service.

  2. Register the domain name requiring resolution.

  3. Test the resolution effectiveness using the HTTP API.

  4. Compile and execute the provided Android and iOS sample projects to facilitate quick integration and verification of the solution.

Step 1: Service activation

  1. Log on to the EMAS console.

  2. Choose the appropriate legal resources and click Submit.

  3. The EMAS service is now active.

Note

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:

  1. Log on to the EMAS console.

  2. In the left-side navigation pane, select Domain Management.

  3. 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}

Note

Replace ${accountId} and ${host} with the actual values from your console.

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: