Resolver

Each resolver entry defines one DNS backend or resolver wrapper that escapers can reference by name.

Every resolver configuration item is a map with two required keys:

  • name, which defines the resolver name

  • type, which selects the concrete resolver type and therefore determines how the remaining keys are interpreted

Pick the resolver type that matches how you want lookups to behave, then use the rest of the page as the shared reference for cache and wrapper settings.

Resolvers

Common Keys

These keys are shared by most resolver types.

Most of them belong to the resolver wrapper and cache runtime rather than to a specific DNS library.

name

required, type: metric node name

The resolver name.

type

required, type: str

The resolver type.

graceful_stop_wait

optional, type: humanize duration

How long to wait before actually shutting down the resolver thread. This applies to the cache runtime.

There may still be queries running inside the resolver. Instead of waiting for all of them to finish, vey-proxy waits for this fixed interval.

default: 30s

protective_query_timeout

optional, type: humanize duration

Timeout for queries sent to the resolver driver. This applies to the cache runtime.

This value should be greater than any driver-specific timeout.

default: 60s

positive_min_ttl

optional, type: u32

Minimum TTL for positive responses. This applies to the resolver driver.

default: 30

positive_max_ttl

optional, type: u32

Maximum TTL for positive responses. It should be greater than positive_min_ttl. This applies to the resolver driver.

default: 3600

negative_min_ttl

optional, type: u32

Minimum TTL for negative responses. This applies to the resolver driver.

default: 30, alias: negative_ttl

TTL Calculation

A positive record is cached after it is fetched from the driver. Two TTL values are then used in the cache runtime:

  • expire_ttl

    If the record is still present in cache, it can be returned directly.

    Once this TTL is reached, the next request triggers a fresh query immediately.

  • vanish_ttl

    The record is removed from the cache.

The cache TTLs are calculated as follows:

if [ $RECORD_TTL -gt $(($POSITIVE_MAX_TTL + $POSITIVE_MIN_TTL)) ]
then
  EXPIRE_TTL=$POSITIVE_MAX_TTL
  VANISH_TTL=$RECORD_TTL
elif [ $RECORD_TTL -gt $(($POSITIVE_MIN_TTL + $POSITIVE_MIN_TTL)) ]
then
  EXPIRE_TTL=$(($RECORD_TTL - $POSITIVE_MIN_TTL))
  VANISH_TTL=$RECORD_TTL
elif [ $RECORD_TTL -gt $POSITIVE_MIN_TTL ]
then
  EXPIRE_TTL=$POSITIVE_MIN_TTL
  VANISH_TTL=$RECORD_TTL
else
  EXPIRE_TTL=$POSITIVE_MIN_TTL
  VANISH_TTL=$(($POSITIVE_MIN_TTL + 1))
fi