PowerShell based DNS client providing similar functionality to Resolve-DnsName
, nslookup
, and dig
.
Supports all known record types.
Indented.Net.Dns can be installed from the PowerShell gallery.
Install-Module Indented.Net.Dns
Indented.Net.Dns is compatible with PowerShell 5, 6 and 7 and has been tested on Windows and CentOS.
Indented.Net.Dns provides a number of commands to execute DNS queries against name servers.
Get-Dns [[-Name] <String>]
[[-RecordType] <RecordType>]
[-RecordClass <RecordClass>]
[-NoRecursion]
[-DnsSec]
[-EDns]
[-EDnsBufferSize <UInt16>]
[-NoTcpFallback]
[-SearchList <String[]>]
[-Tcp]
[-Port <UInt16>]
[-Timeout <Byte>]
[-IPv6]
[-ComputerName <String>]
[-DnsDebug]
Short-cut to execute a query for bind.version.
Get-DnsVersion [-Tcp]
[[-Port] <UInt16>]
[-IPv6]
[[-ComputerName] <String>]
Equivalent to:
Get-Dns -Name bind.version. -RecordType TXT -RecordClass CH
Get-DnsZoneTransfer [-ZoneName] <String>
[-SerialNumber <UInt32>]
[-Port <UInt16>]
[-Timeout <Byte>]
[-IPv6]
[-ComputerName <String>]
Uses Get-Dns to search the authoritative name servers of a zone for a specific record.
Search-Dns [-Name] <String>
[-ZoneName] <String>
[[-RecordType] <RecordType>]
[-Tcp]
[-Port <UInt16>]
[-IPv6]
[-ComputerName <String>]
Performs an iterative search for a record from either root hints of a specified DNS server.
Trace-Dns [-Name] <String>
[-ZoneName] <String>
[[-RecordType] <RecordType>]
[-Tcp]
[-Port <UInt16>]
[-IPv6]
[-ComputerName <String>]
The classes within this module are accessible by using the module.
using module Indented.Net.Dns
This module contains a large number of classes. Notable classes are shown below.
Describes a DNS message to send or receive.
DnsMessage new()
DnsMessage new(String name, RecordType recordType)
DnsMessage new(String name, RecordType recordType, RecordClass recordClass)
DnsMessage new(String name, RecordType recordType, RecordClass recordClass)
DnsMessage new(String name, RecordType recordType, RecordClass recordClass, UInt32 serial)
DnsMessage new(Byte[] bytes)
void SetEDnsBufferSize()
void SetEDnsBufferSize(UInt16 size)
void SetAcceptDnsSec()
void DisableRecursion()
The DnsClient class uses TCP and UDP sockets to communicate with a remote DNS server.
DnsClient new()
DnsClient new(Boolean useTcp, Boolean useIPv6)
DnsClient new(Boolean useTcp, Boolean useIPv6, Int32 receiveTimeout, Int32 sendTimeout)
void SendQuestion(DnsMessage message, IPAddress ipAddress)
void SendQuestion(DnsMessage message, IPAddress ipAddress, UInt16 port)
DnsMessage ReceiveAnswer()
Byte[] ReceiveBytes()
void Close()