API Reference
DnsAnswer
Represents a DNS resource record returned by the server. See RFC 1035 for the resource record format.
Inheritance
- ValueType
- DnsAnswer
Usage
This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.
Returned or exposed by
- Method ClientX.ResolveAll
- Method ClientX.ResolveAll
- Method ClientX.ResolveAllSync
- Method ClientX.ResolveAllSync
- Method ClientX.ResolveFirst
- Method ClientX.ResolveFirstSync
- Property DnsResponse.Additional
- Property DnsResponse.Answers
- Property DnsResponse.Authorities
- Method DnsQueryable.GetEnumerator
- Method DnsQueryable.ToListAsync
- Method DnsQueryableExtensions.ToListAsync
- Property ZoneTransferResult.Records
- Property ZoneTransferResult.SoaRecord
Accepted by parameters
- Method ClientX.FilterAnswers
- Method ClientX.FilterAnswersRegex
- Method ClientX.HasMatchingAnswers
- Method ClientX.HasMatchingAnswersRegex
- Method DnsAnswerMinimal.op_Explicit
- Method DnsAnswerMinimalHelper.ConvertFromDnsAnswer
- Method DnsRecordFactory.Create
- Method DnsSecValidator.TryParseDnsKey
- Method DnsQueryableExtensions.ToListAsync
- Constructor ZoneTransferResult.ZoneTransferResult
Constructors
Methods
CleanupTxtRecordData(System.String data) #Centralized cleanup method for TXT record data to ensure consistency across all DNS providers. Removes empty lines, trims whitespace, and normalizes line endings.
Parameters
- data System.String
- The TXT record data to clean up
Returns
Cleaned TXT record data
ConvertData() #Converts the data to a string trying to unify the format of the data between different providers
Returns
Record data converted to a unified string format.
ConvertToMultiString() #Converts the raw data to multiple strings. By default, DNS records are stored as a single string. Some records (mainly TXT) can be split into multiple strings and maximum length of a string is 255 characters. This method tries to preserve the original format of the data in case user needs to check for that format.
Returns
Array of strings representing record data.
CountOccurrences(System.String text, System.String pattern) #Counts occurrences of a substring in a string
Parameters
- text System.String
- The text to search in
- pattern System.String
- The pattern to search for
Returns
Number of occurrences
HasObviousConcatenation(System.String data) #More aggressive detection for obvious concatenation patterns
Parameters
- data System.String
- The cleaned TXT record data
Returns
True if obvious concatenation is detected
IsConcatenatedTxtRecord(System.String data) #Determines if a TXT record appears to be concatenated based on common patterns
Parameters
- data System.String
- The cleaned TXT record data
Returns
True if the record appears to be concatenated
NormalizeLineEndings(System.String data) #Normalizes line endings to '\n' regardless of the original platform.
Parameters
- data System.String
- Input string
Returns
String with '\n' line endings
ParseNaptrRDataAndFormat(System.Byte[] rdata) #Converts a special format like "\u0003one\u0003one\u0003one\u0003one\0" to a standard dotted format.
Parameters
- rdata System.Byte[]
- The raw data in special format.
Returns
The data in standard dotted format.
SetFilteredData(System.String filteredData) #Sets filtered data that will override the normal ConvertData() behavior. This is used internally for filtering operations. Not thread-safe; callers should ensure they operate on a local copy of the struct, not shared across threads.
Parameters
- filteredData System.String
- The filtered data to return from the Data property.
SplitByEqualsPattern(System.String data) #Splits concatenated records by analyzing equals sign patterns
Parameters
- data System.String
- The concatenated data
Returns
List of potential record segments
SplitConcatenatedTxtRecord(System.String data) #Splits concatenated TXT records into separate lines
Parameters
- data System.String
- The concatenated TXT record data
Returns
Properly separated TXT records
Inherited Methods
public override Boolean Equals(Object obj) #BooleanParameters
- obj Object
Properties
public String Name { get; set; } #JsonPropertyName("name")This is the name of the record. Removes the trailing dot if it exists to make it easier to compare with other records across providers.
public Int32 TTL { get; set; } #JsonPropertyName("TTL")The number of seconds for TTL (time to live) for the record.
public String DataRaw { get; set; } #JsonPropertyName("data")The raw value of the DNS record for the given name and type as received from the server. The data will be in text for standardized record types and in HEX for unknown types.
public String Data { get; } #JsonIgnorethe value of the DNS record for the given name and type after being processed and converted to a string.
public String[] DataStrings { get; } #JsonIgnoreThe value of the DNS record for the given name and type, split into multiple strings if necessary. Tries to preserve the original format of the data.
public Object TypedRecord { get; } #JsonIgnoreReturns the record parsed into a typed representation when supported.
public String[] DataStringsEscaped { get; } #JsonIgnoreThe value of the DNS record for the given name and type, escaped if necessary removing the quotes completely.