Marmos
v juptune
v asn1
v lang
v ast
v Classes
v Enums
v ir
v parser
v Enums
v Structs
v core
v crypto
v keyexchange
v memory
v data
v alphabet
v buffer
v json
v builder
v parser
v Enums
v Structs
v serialise
v Structs
v Templates
v pem
v Enums
v Structs

Functions dnsQueryRfc1035

1
2
3
4
5
6
7
8
9
module juptune.dns.clients.rfc1035;

Result dnsQueryRfc1035(
    IpAddress nameserverIp, 
    DnsQuery query, 
    ubyte[] readBuffer, 
    ulong readBufferUsed, 
    DnsRfc1035QueryConfig config = DnsRfc1035QueryConfig(Duration(30000000L), 3u, Duration(30000000L), false)
);

Documentation

Performs a DNS query using the unencrypted UDP/TCP format initially described in RFC1035.

Notes

This client supports EDNS. If readBufferis larger than DNS_RFC1035_MIN_BUFFER_SIZEthen EDNS is used to specify that readBuffer.lengthis our max supported response size.

It is recommended to set readBuffer's length to DNS_RFC1035_RECOMMENDED_BUFFER_SIZEin most cases.

If this function throws an error, the contents of readBufferand readBufferUsedare undefined.

While this function does call dnsDecodePayloadto ensure the payload is valid, it is left to the caller to also call dnsDecodePayloadfor its own purposes.

This function does not automatically throw if the payload contains an error code.

TCP

This client will switch to TCP under the following conditions: The UDP connection times out too many times (controlled by `config`). The UDP response is truncated. TCP is forced by `config.forceTcp`.

Params

Throws

DnsRfc103ClientError.slowConnectionif the server sends the header length prefix too slowly.

DnsRfc103ClientError.bufferTooSmallif the read buffer is unable to fit the server's full response.

Anything that dnsEncodeQueryand dnsDecodePayloadcan throw.

Anything that UdpSocketand TcpSocketmay throw.

Returns

A Result