Introduction
All APIs in this document require you to write custom resolution functions to perform custom resolution if the basic resolution scenarios do not meet your requirements.
You can configure the common parameters for each custom domain name resolution request by setting global parameters for custom resolution.
Custom synchronous non-blocking resolution interfaces
Using a custom synchronous non-blocking interface to parse a domain name does not block the current thread. However, it may return an empty result.
This interface queries only the cache and returns the result. If the cache does not contain a result or the cached result has expired, a worker thread resolves the domain name. The cache is then updated with the new result for subsequent calls.
getIpsByHostAsync
Performs custom resolution for IPv4 addresses in a synchronous, non-blocking way.
Interface definition
HTTPDNSResult getIpsByHostAsync(String host, Map<String,String> params, String cacheKey)
Class
HttpDnsService
Introduced in version
1.3.0
Deprecated version
2.3.2
Replacement interface
Parameters
Parameter | Type | Required | Description |
host | String | Yes | The domain name to parse. |
params | Map<String, String> | Yes | The extra parameters for domain name resolution. These correspond to the event.parameters parameter in the custom resolution function on the server. |
cacheKey | String | Yes | The local cache key for the domain name. If a change in extra parameters requires re-resolution from the server, change the cacheKey. |
Return value
Type | Description |
The resolution result. |
getHttpDnsResultForHostAsync
Performs custom resolution for IPv4 addresses in a synchronous, non-blocking way.
Interface definition
HTTPDNSResult getHttpDnsResultForHostAsync(String host, Map<String, String> params, String cacheKey);
Class
HttpDnsService
Introduced in version
2.0.2
Deprecated versions
2.4.0
Replacement interface
Parameters
Parameter | Type | Required | Description |
host | String | Yes | The domain name to parse. |
params | Map<String, String> | Yes | The extra parameters for domain name resolution. These correspond to the event.parameters parameter in the custom resolution function on the server. |
cacheKey | String | Yes | The local cache key for the domain name. If a change in extra parameters requires re-resolution from the server, change the cacheKey. |
Return value
Type | Description |
The resolution result. |
getIpsByHostAsync
Performs custom resolution for IP addresses of a specified type in a synchronous, non-blocking way.
Interface definition
HTTPDNSResult getIpsByHostAsync(String host, RequestIpType requestIpType, Map<String,String> params, String cacheKey)
Class
HttpDnsService
Introduced in version
2.0.2
Deprecated in version
2.4.0
Replacement interface
Parameters
Parameter | Type | Required | Description |
host | String | Yes | The domain name to parse. |
requestIpType | RequestIpType | Yes | The IP type to parse. Use RequestIpType.both. |
params | Map<String, String> | Yes | The extra parameters for domain name resolution. These correspond to the event.parameters parameter in the custom resolution function on the server. |
cacheKey | String | Yes | The local cache key for the domain name. If a change in extra parameters requires re-resolution from the server, change the cacheKey. |
Return value
Type | Description |
The resolution result. |
getHttpDnsResultForHostAsync
Interface definition
HTTPDNSResult getHttpDnsResultForHostAsync(String host, RequestIpType type, Map<String, String> params, String cacheKey)
Class
HttpDnsService
Introduced in version
2.0.2
Deprecated in version
2.4.0
Replacement interface
Parameters
Parameter | Type | Required | Description |
host | String | Yes | The domain name to parse. |
requestIpType | RequestIpType | Yes | The IP type to parse. Use RequestIpType.both. |
params | Map<String, String> | Yes | The extra parameters for domain name resolution. These correspond to the event.parameters parameter in the custom resolution function on the server. |
cacheKey | String | Yes | The local cache key for the domain name. If a change in extra parameters requires re-resolution from the server, change the cacheKey. |
Return value
Type | Description |
The resolution result. |