Table of Contents

Class DnsLookup

Namespace
Xping.Sdk.Actions
Assembly
Xping.Sdk.dll

The DnsLookup class is a concrete implementation of the TestComponent class that is used to perform a DNS lookup. It uses the mechanisms provided by the operating system to perform DNS lookups.

public sealed class DnsLookup : TestComponent, ITestComponent
Inheritance
DnsLookup
Implements
Inherited Members

Remarks

note

This component operates without any dependency on other components. Please also note, the DNS lookup method may use cached data from the local machine if the DNS information for the host has been cached previously.

The DnsLookup mechanism works by sending a query to a DNS server and receiving a response that contains the IP address of the requested domain name. The query can be either recursive or iterative, depending on the configuration of the DNS server. A recursive query instructs the DNS server to return the final answer or an error, while an iterative query instructs the DNS server to return the best answer it has or a referral to another DNS server. The DnsLookup component uses the mechanisms provided by the operating system to perform DNS lookups. This means that it can handle both iterative and recursive queries, depending on the configuration of the DNS server. The DNS lookup method can also follow the referrals until it reaches the authoritative DNS server that has the definitive answer. However, the component does not expose any option to specify the query type or the DNS server to use.

Constructors

DnsLookup()

Initializes a new instance of the DnsLookup class.

public DnsLookup()

Fields

ComponentName

The name of the test component that represents a DnsLookup test operation.

public const string ComponentName = "DNS lookup"

Field Value

string

Remarks

This constant is used to register the DnsLookup class in the test framework.

Methods

HandleAsync(Uri, TestSettings, TestContext, IServiceProvider, CancellationToken)

This method performs the test step operation asynchronously.

public override Task HandleAsync(Uri url, TestSettings settings, TestContext context, IServiceProvider serviceProvider, CancellationToken cancellationToken = default)

Parameters

url Uri

A Uri object that represents the URL of the page being validated.

settings TestSettings

A TestSettings object that contains the settings for the test.

context TestContext

A TestContext object that represents the test context.

serviceProvider IServiceProvider

An instance object of a mechanism for retrieving a service object.

cancellationToken CancellationToken

An optional CancellationToken object that can be used to cancel the this operation.

Returns

Task

TestStep object.