Add a response handler for ignoring all queries
Dropping all incoming queries is a typical use case for a custom server used in BIND 9 system tests. Add a response handler implementing that behavior so that it can be reused.
This commit is contained in:
@@ -383,6 +383,17 @@ class ResponseHandler(abc.ABC):
|
||||
yield DnsResponseSend(qctx.response)
|
||||
|
||||
|
||||
class IgnoreAllQueries(ResponseHandler):
|
||||
"""
|
||||
Do not respond to any queries sent to the server.
|
||||
"""
|
||||
|
||||
async def get_responses(
|
||||
self, qctx: QueryContext
|
||||
) -> AsyncGenerator[ResponseAction, None]:
|
||||
yield ResponseDrop()
|
||||
|
||||
|
||||
class DomainHandler(ResponseHandler):
|
||||
"""
|
||||
Base class used for deriving custom domain handlers.
|
||||
|
||||
Reference in New Issue
Block a user