Skip to content

Instantly share code, notes, and snippets.

@DiHo78
Last active September 27, 2020 13:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DiHo78/43b8939c0c8f8da21af8b29a60e597c2 to your computer and use it in GitHub Desktop.
Save DiHo78/43b8939c0c8f8da21af8b29a60e597c2 to your computer and use it in GitHub Desktop.
#'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