Skip to content

Instantly share code, notes, and snippets.

@DiHo78
Last active Sep 27, 2020
Embed
What would you like to do?
#'CNAME/Alias erstellen
#'''''''''''''''''''''''''
# install-module dnsserver
<# Reminder
https://docs.microsoft.com/en-us/powershell/module/dnsserver/?view=win10-ps
DnsServer Module can be obtained either by installing DNS Server role or adding the DNS Server Tools part of Remote Server Administration Tools (RSAT) feature.
#>
$domain = 'domain.local'
$AliasName = 'SQL-MyApp.domain.local'
$targetServer = 'MyTgtServer'
$target = $targetServer + '.' + $domain
$target
$DNSSrv = 'MyDNS.Domain.local'
Add-DnsServerResourceRecordCName -Name $AliasName -HostNameAlias $target -ZoneName $domain -Verbose -ComputerName $DNSSrv -WhatIf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment