The following article is a summary to add host name (A) records in DNS via PowerShell.
For DNS servers hosted on Windows 2008, use this script to add A records.
The script requires a CSV file with the host names and IP addresses that are planned to be added. The CSV file must contain a header row with Name and IP. To add A records
- Open an elevated PowerShell console from one of the servers hosting DNS
- Run .\DNSHostRecordsPTR.ps1 to add the info from the CSV file as A records to DNS.
In my opinion, adding A records is simpler in Windows 2012 or newer because you have a little more control of some of the settings.
Open an elevated PowerShell console from one of the servers hosting DNS. The following command can be used to add new A records. The bold, red text is user input based on A record information to add.
Add-DnsServerResourceRecordA -Name "HOSTNAME" -ZoneName "DNSZoneName.local" -AllowUpdateAny -IPv4Address "X.X.X.X" -TimeToLive 01:00:00