One of the great things I like about the (not so) new Windows 2008 R2 Powershell modules is that we can now more easily manage the core Microsoft Networking services (DNS, DHCP).
I want to share a little script I built that will add/update Host Records fed from a CSV file.
If you use this library, please send me your feedback and add a link to this page.
In addition you can Donate via Paypal or send me an gift card The library is avaible on Nuget, too:
What this means in practice is the following: This means the DHCP server computer account will own certain records in DNS, such as the PTR records and even some A records for older hosts.
In additon, hosts can change the records and then become the owner of the record.
No that there is a difference in how Set-DNSServer Resource Record works compared to the ADD command.
This one requires that we get the record, modify the IPV4Address field, then use it to replace the old object. You can easily modify this script, so that you can pass the DNS server name from the CSV file (updating lots of records on multiple DNS servers) or updating multiple record type (A Records, CNAME Records).
In the past automating this kind of thing was possible using a combination of WMI and VBS/Powershell and or batch scripting and using the famous DNSCMD.
My script script will not work on any DNS server, you need to run Windows 2008 or later DNS, running against Windows 2003 DNS servers will yield strange/wrong results. String]$Resource Record File = "C:\Temp\somefile.txt", [Parameter(Mandatory=$false)][System. String]$dnsserver = "DNS.constoso.com" ) import-module DNSServer Write-Warning "This script updates DNS resource records in DNS based on information in a CSV file.