on_response Event
Fires after a DNS query.
Syntax
class DNSResponseEventParams(object): @property def request_id() -> int: ... @property def domain() -> str: ... @property def status_code() -> int: ... @property def description() -> str: ... @property def authoritative() -> bool: ... # In class DNS: @property def on_response() -> Callable[[DNSResponseEventParams], None]: ... @on_response.setter def on_response(event_hook: Callable[[DNSResponseEventParams], None]) -> None: ...
Remarks
The on_response event will fire after a call to query. The RequestId parameter contains the request id associated with the original query. Domain is the domain of the query. The Authoritative parameter is true if the response is from an authoritative name server. If there is an error returned by the server, StatusCode and Description provide them.
Once the query is complete, a single on_response event will fire, and the following properties will contain the results:
status_code | The success or error code of the DNS query. |
status | A standard string interpretation of status_code. |
records | The records in the last DNS response. |
record_source | The source (type) of records being listed. |