Get-DnsServerResourceRecord
You saw how to discover the zones on a DNS server in the first post in this series. Now its time to discover the records in a zone. For that you need Get-DnsServerResourceRecord. The syntax is:...
View ArticleDNS zones
I’m working through the commonly used DNS server cmdlets to determine if everything works in PowerShell core. First up is the cmdlet to get the DNS zones on your DNS server. PS> Get-DnsServerZone |...
View ArticleTest DNS servers
Had a recent comment about testing DNS servers which got me thinking how do I test DNS servers. I decided I wanted to get the DNS server address from the client, ping the DNS server to test network...
View ArticleFinding DNS static records
An interesting question from the forums about finding DNS static records You can view the records in a DNS zone Get-CimInstance -Namespace root\MicrosoftDNS -ClassName MicrosoftDNs_Atype -ComputerName...
View ArticleCreating DNS records
Following on from my previous post about creating a reverse lookup zone in DNS here’s a function to create records in that zone. The function takes an IP address and name (of host) and uses...
View ArticleCreate a reverse lookup zone
I needed to create a DNS reverse lookup zone for my test environment. With Windows Server 2012 R2 I’ve got cmdlets available for managing DNS servers – the DnsServer module. You need to install the DNS...
View ArticleNSlookup in PowerShell
nslookup.exe is a command line executable that is used to discover the IP address of a remote machine from its FQDN. The results look something like this: PS> nslookup powershell.org DNS request...
View ArticleError handling for DNS lookups
Interesting question on the forum regarding the Resolve-DNSname cmdlet. This is part of the DNSclient module introduced with Windows 8. If the DNS record is found everything is good £>...
View ArticleParsing ipconfig /displaydns with regular expressions
In yesterdays post I used a series of split operations to parse the strings produced by ipconfig /displaydns Regular expressions should give a more power full way to perform this task. Not being a...
View ArticleParsing ipconfig /displaydns
A recent question on the forum asked how you could get the contents on Windows 7 machines and earlier. On later machines – Windows 8 and above – its easy because you can use Get-DnsClientCache from...
View ArticleDNS client settings
Following yesterdays post there are a couple of other cmdlets worth looking at if you want to dig into the DNS settings on your client machines. Get-DnsClient wil show you the DNS relsted settings for...
View ArticleHave you been talking to strangers?
Want to know the machines to which your machine has been connecting? Try looking in the client DNS cache: Get-DnsClientCache will show a wealth of useful data. All in the form: £>...
View ArticleDNS zone types
I was looking at the DNS zones for a project I’m working on. I needed to discover the conditional forwarder zone and hence the IP address of the DNS server to which the forwarding was occurring. The...
View ArticleCreating DNS PTR records
When I was writing the DNS chapter of PowerShell in Practice I couldn’t get the CreateInstanceFromPropertyData method on the MicrosoftDNS_PTRType class to work. Revisiting DNS for AD management in a...
View ArticleDnsClient module: #2 DnsClient & Cache
The DnsClient module has a number of Get- cmdlets Get-DnsClient | Format-List InterfaceAlias, ConnectionSpecificSuffix, Register*, UseSuffix* An example of the output is InterfaceAlias...
View ArticleDnsClient module: #1 Get-DnsClientServerAddress
Started to investigate the DnsClient module. First cmdlet to catch my eye was Get-DnsClientServerAddress. Always good to know a way to find the DNS server. PS> Get-DnsClientServerAddress...
View ArticleFinding the primary name of a DNS alias record
A forum question asked how to find the primary name from an alias or CNAME record. Get-WmiObject -Namespace 'root\MicrosoftDNS' -Class MicrosoftDNS_CNAMEType ` -Filter "ContainerName = 'Manticore.org'"...
View ArticleGet Global Catalog from DNS
One option for finding global catalog servers is often overlooked – DNS. In an AD environment DNS stores the SRV records that advertise the services domain controllers can deliver $dnsserver = "dc02"...
View ArticleDNS cmdlets in PowerShell 3
There are a number of modules related to DNS ModuleType Name ———- —- Manifest DnsClient Manifest DnsConfig Binary DnsLookup Manifest DnsNrpt If we start with the DnsClient module we get these functions...
View ArticleWMI and Network Adapters: 5
Does a machine have problems communicating on the network? Then one troubleshooting step is to check the DNS servers it is using 001 002 003 004 Get-WmiObject -Class Win32_NetworkAdapterConfiguration...
View Article