Last modified at 11/2/2013 9:15 PM by Koen Zomers

​Adding a DNS record to Windows 2008 R2 DNS can be done via the following PowerShell code:

#Create new Host (A or AAAA) in DNS 
$dnsServer = "ad.ict24h.intranet" #This DNS Server stores the Host A record 
$dnsZone = "ict24h.intranet" 
$hostA = $waHostHeader #use top-level site collection 
$class = 1 
$ttl = 3600 
$ipAddress = "192.168.1.100" #Ip Address of SharePoint Web Server 
Write-Host "Please wait some minutes for creating new Host A record process...." 
$dnsAType = [wmiclass] "\\$dnsServer\root\MicrosoftDNS:MicrosoftDNS_AType" 
$dnsAType.CreateInstanceFromPropertyData($dnsServer$dnsZone$hostA$class$ttl$ipAddress

Source: http://gallery.technet.microsoft.com/office/Fully-configure-Host-d4027a48

From Windows 2012 onwards, PowerShell commands to influence DNS records are built into the operating system. For an overview of the available PowerShell commands, see:

http://technet.microsoft.com/en-us/library/jj649850%28v=wps.620%29.aspx