Powershell: Checking multiple dns records for multiple domains
I don’t know how useful this will be for others, but in our case we had a need to check a few public dns records on some of our domains. Doing so by using a web portal will be time consuming and straight out boring. Luckily you can use Powershell for such things: First we need to to save our domains in an array: $domains = @(“domainA.com”, “domainB.com”, “domainC.com”) Then we send that array into a foreach loop: foreach ($element in $domains) { Resolve-DnsName -server 8.8.8.8 record.$($element) } You might notice that I use Google’s public dns servere here, but you can use whatever dns server you want, or just leave the -server part out. The example above is pretty basic and only checks for an A record. In our case we needed to check several SRV records for each of the domains, so I had to extend the script…