Frequently asked questions about HTTPDNS features and usage

更新时间:
复制 MD 格式

Question 1: Can HTTPDNS be used with CDN?

  • Yes, it can.


Question 2: Is there a queries per second (QPS) limit for service IP calls?

  • No, there is no limit.


Question 3: Is there a method to integrate static HTML pages in a WebView?


Question 4: The client reports an "UnknownHost" error. Does this mean there is a domain name resolution problem?

  • Yes. The DNS parsing failed.


Question 5: Can the utdevice in HTTPDNS be removed? We use a third-party payment service that has Alipay integrated.


Question 6: Are the domain name resolution statistics in the console real-time? How often is the resolution count updated? I have performed several resolutions, but the data has not been updated.

  • No, the statistics are not real-time. The console displays statistics for server-side requests, and the resolution count is updated daily. You can view the previous day's data on the current day. To see the specific counts for each date, click Details.


Question 7: Why is there no request header after integrating HTTPDNS? Why is the host parameter missing from the resolution data?

  • You must set the HOST parameter in your code. This parameter is part of the network request header.

  • If you have already set the request header, you can print the header data to verify it.


Question 8: The demo shows a fallback mechanism for clients behind a proxy. Are there other situations where a fallback is needed?

  • Yes. You should fall back to the standard DNS process if the API call returns an empty IP address.


Question 9: Why does WebView only intercept GET requests and not POST requests that have a body?

  • HTTPDNS for WebView does not intercept the request body because it cannot access the complete request information. For more information, see Use HTTPDNS in WebView on iOS.


Question 10: Is IP resolution based on the "proximity principle"?

  • Yes. In the context of HTTPDNS, "proximity" means that if your authoritative DNS is configured for region-based scheduling, HTTPDNS adheres to that resolution policy.


Question 11: HTTPDNS resolves a domain name to two or more different IP addresses. How can I control the weight of each IP address?

  • Configuring the weight for a domain name is a scheduling policy. HTTPDNS does not interfere with scheduling policies. You can configure this policy in your domain name's authoritative DNS.


Question 12: For users outside of China, will HTTPDNS resolve to an IP address in mainland China? How does using HTTPDNS affect users outside of China?

  • HTTPDNS does not change the domain name's resolution policy. This policy is configured in your domain name's authoritative DNS.

  • HTTPDNS returns the results from the authoritative DNS. If the authoritative DNS provides different resolutions based on the line or region, HTTPDNS automatically supports this feature.


Question 13: If I use a mix of Alibaba Cloud CDN, IP Address of Anti-DDoS Proxy instance, and Border Gateway Protocol (BGP), can HTTPDNS route to the nearest point of presence (POP)?

  • HTTPDNS returns the results from the authoritative DNS. If the authoritative DNS provides different resolutions based on the line or region, such as routing to the nearest point of presence (POP), HTTPDNS automatically supports this feature.


Question 14: Does the SDK's `setPreResolveHosts` operation cause the HTTPDNS server to purge its DNS cache?

  • No, it does not. This operation allows the app to pre-fetch the resolution results. The cache on the HTTPDNS server is refreshed only when an entry expires. Pre-resolution means resolving a domain name before its IP address is needed. This ensures that the IP address is already resolved and cached when required.


Question 15: Can HTTPDNS resolve domain names that do not have an ICP filing?

  • HTTPDNS is a recursive resolution service. It simply passes through the content returned by the authoritative name server.

  • The domain name resolution functionality of HTTPDNS is not directly related to the ICP filing status. ICP filing regulations are set by the Ministry of Industry and Information Technology (MIIT). For more information, see ICP Filing.


Question 16: Regarding fallback, if I can obtain an IP address but an error occurs when I use it to make a request (such as a 400 error), should I fall back?

  • Fallback at the domain name resolution layer: A 400 error indicates that the request has passed the DNS stage and the resolved IP address is correct. The issue is related to access through a direct IP connection. If HTTPDNS is integrated and tested properly, 400 errors should not occur.

  • At the business layer: If your service returns a 400 error, you should check and follow your app's existing fallback or retry policy. This is not directly related to the use of HTTPDNS.


Question 17: If I do not enable persistent caching with `setCachedIPEnabled`, does every call to `getIPByHostAsync` fetch the IP address from the HTTPDNS server?

  • No, it does not. When `setCachedIPEnabled` is enabled, the local persistent cache is loaded into the memory cache when the device's storage is accessed. Each IP address has a time-to-live (TTL). A network request is made only when the TTL expires. The network request then updates the local persistent cache.

  • If this feature is disabled, the IP address from the memory cache is still used first, provided its TTL has not expired. In this case, no network request is made.


Question 18: What is the purpose of the secretKey for HTTPDNS authentication? What should I do after it expires in 10 minutes?

  • The secretKey is required for Alibaba Cloud users to authenticate HTTPDNS API calls. The server is responsible for generating this key.

  • To view the key, go to the Console > Authentication Configuration > Authentication secretKey. You do not need to handle key expiration during integration. The key expires to prevent network requests from being captured and misused.

  • The SDK automatically resets the authentication UNIX timestamp for each network request. Therefore, you do not need to worry about the UNIX timestamp expiring.


Question 19: I receive an "InvalidSignature" error during initialization.

  • Example:

    Async request for www.aliyun.com error: Error Domain=httpdns.request.lookupAllHostsFromServer-HTTP Code=10004 "(null)" UserInfo={ErrorMessage=InvalidSignature}
  • If resolution works without a secretKey but fails when one is used, verify the following:

    • Does the secretKey correspond to the accountId?

    • Ensure that the value of the secretKey parameter is correct.

  • Note: The secretKey is not the appSecret.

  • To obtain the secretKey:

    • For more information, see Problems.

    • Alternatively, check the value of httpdns.secretKey in the AliyunEmasServices-Info.plist file.

Question 20: How do I disable the HTTPDNS service?

  • The EMAS console does not provide a button to directly disable this product.

  • In the EMAS HTTPDNS console, go to the Domain Names page and delete all your domain names. This action stops the resolution service and prevents further billing.

  • Alternatively, you can stop calling the API in your code. You can do this by removing or unregistering the HTTPDNS initialization in your app.


Question 21: How should I handle wildcard domain names in HTTPS scenarios?