Zimbra Talk - DNS over Windows Server


Zimbra Talk - DNS over Windows Server

   KB 22803        Last updated on 10/10/2016  




0.00
(0 votes)
Article-check.png  - This is certified documentation and is protected for editing by Zimbra Employees & Moderators only.

Zimbra Talk relies on a perfect DNS configuration, while the main installation offers examples for two of the most used DNS servers, bind and dnsmasq, it's however a lot of environments using DNS over Windows Server. On this article we will cover an Script created by Zimbra Engineers to create all the needed DNS entries.

Zimbra Talk DNS for Windows, Powershell Script

You can find the source code of the Powershell Script below, or by downloading it from here:

<#
.SYNOPSIS
This is a simple Powershell script to add DNS entries about the XMPP services

.DESCRIPTION
The script will add the A, TXT and SRV records required by Zimbra Talk to the given DNS server. Ensure that the script is run with the correct credentials.

.EXAMPLE
./AddDNS.ps1 -DNS DNS_Server -Domain Domain_Name -IP IP_of_the_XMPP_Server -zTalk Zimbra Talk server name
DNS    - IP or FQDN of the Domain Server (DNS)
Domain - Domain portion of the XMPP server. If your xmpp server is xmpp.dom.local, enter dom.local
IP     - IP Address of the XMPP server (xmpp.dom.local)
zTalk  - Zimbra Talk server name

.EXAMPLE
./AddDNS.ps1 -DNS DNS_Server -Domain Domain_Name -IP IP_of_the_XMPP_Server -zTalk -Verbose
Shows verbose text output

.RELEASE NOTES
	VERSION 1: Gautam Ramachandram
	VERSION 1.2: Edu Godinho (zTalk entry added)

#>
[CmdletBinding(SupportsShouldProcess=$true)]
param (
	[string]$DNS = $(throw "-DNS parameter is required."),
    [string]$Domain = $(throw "-Domain parameter is required."),
    [string]$ip = $(throw "-IP parameter is required." ),
    [string]$ztalk = $(throw "- Zimbra Talk server is required." )
)

if (-not (Test-Connection -ComputerName $DNS -Count 1 -BufferSize 16 -Quiet)){
	Write-Warning "DNS Server - $DNS not found!"
	return
}


$recA = @("xmpp", "conference", "external", "conference.external", "auth", "jitsi-videobridge", "focus", "turn")
$recTXT = @("_xmppconnect.xmpp", "_xmppconnect", "_xmppconnect.external")
$txtTXT = "_xmpp-client-xbosh=https://xmpp." + $Domain + ":443/http-bind"
$recSRV = @("_xmpp-client._tcp",  "_xmpp-server._tcp",  "_xmpp-client._tcp.xmpp", "_xmpp-server._tcp.xmpp", "_xmpp-client._tcp.auth", "_xmpp-server._tcp.auth", "_xmpp-client._tcp.focus", "_xmpp-server._tcp.focus", "_xmpp-client._tcp.jitsi-videobridge", "_xmpp-server._tcp.jitsi-videobridge", "_xmpp-client._tcp.conference",  "_xmpp-server._tcp.conference",  "_xmpp-client._tcp.external",  "_xmpp-server._tcp.external",  "_xmpp-client._tcp.conference.external",  "_xmpp-server._tcp.conference.external")
$ports = @(5222, 5269, 5222, 5269, 5222, 5269, 5222, 5269, 5222, 5269, 5222, 5269, 5222, 5269, 5222, 5269)

Write-Output "Adding A Records ..."
$rec = [WmiClass]"\\$DNS\root\MicrosoftDNS:MicrosoftDNS_ResourceRecord"
for ($i=0; $i -lt $recA.Length; $i++) {
	$s = $recA[$i]
	$text = $s + "." + $Domain + " IN A " + $ip
	Write-Verbose -Message "Adding A record for $s"
	$result = $rec.CreateInstanceFromTextRepresentation($DNS, $Domain, $text)
}

Write-Output "Adding TXT Records ..."
$rec = [WmiClass]"\\$DNS\root\MicrosoftDNS:MicrosoftDNS_TXTType"
$zone = $Domain
$target = $zTalk
$server = $DNS
$class = "1"
$ttl = "3600"
for ($i=0; $i -lt $recTXT.Length; $i++) {
	$s = $recTXT[$i]
	$name = $s + "." + $Domain
	Write-Verbose -Message "Adding TXT record for $s"
	$result = $rec.CreateInstanceFromPropertydata($server, $zone, $name, $class, $ttl, $txtTXT)
}

Write-Output "Adding SRV Records ..."
$rec = [WmiClass]"\\$DNS\root\MicrosoftDNS:MicrosoftDNS_SRVType"
$priority = "0"
$weight = "5"
for ($i=0; $i -lt $recSRV.Length; $i++) {
	$s = $recSRV[$i]
	$name = $s + "." + $Domain
	$port = $ports[$i]
	Write-Verbose -Message "Adding SRV record for $s"
	$result = $rec.CreateInstanceFromPropertydata($server, $zone, $name, $class, $ttl, $priority, $weight, $port, $target)	
}

How it works

Once downloaded, you need to run the Powershell Script by following the next steps, this is an example, replace it with your data:

.\AddDNS.ps1 -DNS 192.168.1.100 -Domain zimbra.io -IP 192.168.1.200 -zTalk talk.zimbra.io -Verbose

You should see the next output while the DNS entries are being created:

Adding A Records ...
VERBOSE: Adding A record for xmpp
VERBOSE: Adding A record for conference
VERBOSE: Adding A record for external
VERBOSE: Adding A record for conference.external
VERBOSE: Adding A record for auth
VERBOSE: Adding A record for jitsi-videobridge
VERBOSE: Adding A record for focus
VERBOSE: Adding A record for turn
Adding TXT Records ...
VERBOSE: Adding TXT record for _xmppconnect.xmpp
VERBOSE: Adding TXT record for _xmppconnect
VERBOSE: Adding TXT record for _xmppconnect.external
Adding SRV Records ...
VERBOSE: Adding SRV record for _xmpp-client._tcp
VERBOSE: Adding SRV record for _xmpp-server._tcp
VERBOSE: Adding SRV record for _xmpp-client._tcp.xmpp
VERBOSE: Adding SRV record for _xmpp-server._tcp.xmpp
VERBOSE: Adding SRV record for _xmpp-client._tcp.auth
VERBOSE: Adding SRV record for _xmpp-server._tcp.auth
VERBOSE: Adding SRV record for _xmpp-client._tcp.focus
VERBOSE: Adding SRV record for _xmpp-server._tcp.focus
VERBOSE: Adding SRV record for _xmpp-client._tcp.jitsi-videobridge
VERBOSE: Adding SRV record for _xmpp-server._tcp.jitsi-videobridge
VERBOSE: Adding SRV record for _xmpp-client._tcp.conference
VERBOSE: Adding SRV record for _xmpp-server._tcp.conference
VERBOSE: Adding SRV record for _xmpp-client._tcp.external
VERBOSE: Adding SRV record for _xmpp-server._tcp.external
VERBOSE: Adding SRV record for _xmpp-client._tcp.conference.external
VERBOSE: Adding SRV record for _xmpp-server._tcp.conference.external

Back to the DNS Manager, you will see now the new DNS entries properly configured:

ZimbraTalkDNS-001.png

Once you have the DNS entries properly configured, you will be able to Install Zimbra Talk now.


Zimbra Talk

zimbra-talk-logo.png

Latest Version: 2.3

Zimbra Talk Resources

Here you can find useful resources for your Zimbra Talk environment

Verified Against: Zimbra Collaboration Suite 8.6 Date Created: 24/06/2016
Article ID: https://wiki.zimbra.com/index.php?title=Zimbra_Talk_-_DNS_over_Windows_Server Date Modified: 10/10/2016



Try Zimbra

Try Zimbra Collaboration with a 60-day free trial.
Get it now »

Want to get involved?

You can contribute in the Community, Wiki, Code, or development of Zimlets.
Find out more. »

Looking for a Video?

Visit our YouTube channel to get the latest webinars, technology news, product overviews, and so much more.
Go to the YouTube channel »


Wiki/KB reviewed by Jorge Edu Godinho Copyeditor Last edit by Jorge de la Cruz Mingo
Jump to: navigation, search