View Source erldns_query_throttle (erldns v4.2.0)

Stateful query throttling. Currently only throttles ANY queries.

This throttling is useful for stopping DNS reflection/amplification attacks.

Summary

Functions

Start the query throttle process.

Stop the query throttle process normally.

Sweep the query throttle table for expired host records.

Throttle the given message if necessary.

Types

throttle_hit_count/0

-type throttle_hit_count() :: non_neg_integer().

throttle_result/0

-type throttle_result() :: {throttled | ok, inet:ip_address() | inet:hostname(), throttle_hit_count()}.

Functions

code_change(PreviousVersion, State, Extra)

handle_call(_, From, State)

handle_cast(_, State)

handle_info(Message, State)

init(_)

start_link()

-spec start_link() -> any().

Start the query throttle process.

stop()

-spec stop() -> any().

Stop the query throttle process normally.

sweep()

-spec sweep() -> any().

Sweep the query throttle table for expired host records.

terminate(Reason, State)

throttle(Message, Context)

-spec throttle(dns:message(), Context :: {term(), Host :: inet:ip_address() | inet:hostname()}) ->
                  ok | throttle_result().

Throttle the given message if necessary.