The 3.8 DNS client introduces a new standardized way to configure a Gateway Service, and helps improve performance.
When migrating to the new client, review the following changes and make adjustments as necessary.
While migration isn’t necessary and the old DNS client is still supported, we recommend migrating to the new DNS client for better performance and observable statistics via the /status/dns
API endpoint.
The new DNS client introduces some changes in the support for different record types.
To avoid issues, make sure that your SRV records configuration is compatible with the new client before migrating.
SRV is included by default in the resolver_family
directive, however the client will only query SRV records if the domain name follows the RFC 2782 format (_SERVICE._PROTO.NAME
).
If the SRV record query fails, the client will not attempt to query the domain’s IP addresses (A and AAAA records) again.
Before enabling SRV support with the new DNS client, make sure that the domain name is registered with your DNS service provider in the supported format.
This standard format also works with the old DNS.
Once you change the SRV format, it will continue to work with the old client, and there will no downtime during migration.
The new DNS client doesn’t need CNAME dereferencing.
This task is entirely handled by the DNS server, per the industry standard.
The new DNS client doesn’t consider the order of record types when querying a domain.
It only queries either IP addresses (A and AAAA records) or SRV records, but not both.
If you had custom values for the directives in the DNS RESOLVER
section in kong.conf
,
you will need to manually add these values to the corresponding directives under New DNS RESOLVER
.
Old DNS resolver directive
|
New DNS resolver directive
|
Notes
|
dns_resolver
|
resolver_address
|
Same behavior.
|
dns_hostsfile
|
resolver_hostsfile
|
Same behavior.
|
dns_order
|
resolver_family
|
The new directive is only used to define the supported query types. There is no specific order.
|
dns_valid_ttl
|
resolver_valid_ttl
|
Same behavior.
|
dns_stale_ttl
|
resolver_stale_ttl
|
Same behavior.
|
dns_not_found_ttl and dns_error_ttl
|
resolver_error_ttl
|
The two old directives are combined into a single directive in the new client.
|
dns_cache_size
|
resolver_lru_cache_size and resolver_mem_cache_size
|
The old directive is split into the following new directives:
-
resolver_lru_cache_size specifies the size of the L1 LRU lua VM cache
-
resolver_mem_cache_size specifies the size of the L2 shared memory cache
|
dns_no_sync
|
N/A
|
This directive no longer exists. Requests are always synchronized in the new client.
|
The new DNS client is disabled by default.
To enable it, set new_dns_client=on
in your kong.conf
file.