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_codeThe success or error code of the DNS query.
statusA standard string interpretation of status_code.
recordsThe records in the last DNS response.
record_sourceThe source (type) of records being listed.

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks 2020 Python Edition - Version 20.0 [Build 8307]