Response Event
Fires after a DNS query.
Syntax
public event OnResponseHandler OnResponse; public delegate void OnResponseHandler(object sender, DnsResponseEventArgs e); public class DnsResponseEventArgs : EventArgs { public int RequestId { get; } public string Domain { get; } public int StatusCode { get; } public string Description { get; } public bool Authoritative { get; } }
Public Event OnResponse As OnResponseHandler Public Delegate Sub OnResponseHandler(sender As Object, e As DnsResponseEventArgs) Public Class DnsResponseEventArgs Inherits EventArgs Public ReadOnly Property RequestId As Integer Public ReadOnly Property Domain As String Public ReadOnly Property StatusCode As Integer Public ReadOnly Property Description As String Public ReadOnly Property Authoritative As Boolean End Class
Remarks
The 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 Response event will fire, and the following properties will contain the results:
StatusCode | The success or error code of the DNS query. |
Status | A standard string interpretation of StatusCode. |
Records | The Records in the last DNS response. |
RecordSource | The source (type) of records being listed. |