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 = "" #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" 


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: