erldns_query_throttle (erldns v7.0.0-rc1)
View SourceStateful query throttling. Currently only throttles ANY
queries.
We should_throttle ANY queries to discourage use of our authoritative name servers for reflection/amplification attacks.
Configuration
{erldns, [
{query_throttle, #{
enabled => boolean(), %% defaults to true
ttl => non_neg_integer(), %% Seconds, defaults to 30
}}
]}
Telemetry events
See segmented_cache
for telemetry events under this module name.
Also emits the following telemetry events:
[erldns, pipeline, throttle]
withhost
in the metadata.
Summary
Types
-type host() :: inet:ip_address() | inet:hostname().
-type throttle_hit_count() :: non_neg_integer().
-type throttle_result() :: ok | throttled.
Functions
-spec clear() -> any().
Clear the cache
-spec throttle(dns:message(), Context :: {term(), Host :: host()}) -> ok | throttled.
Throttle the given message if necessary.