<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>blog.teemu.im &#187; XMPP</title>
	<atom:link href="http://blog.teemu.im/topics/xmpp/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.teemu.im</link>
	<description>i'm teemu and this is my weblog</description>
	<lastBuildDate>Mon, 31 Oct 2011 08:44:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
<atom:link rel="hub" href="http://pubsubhubbub.appspot.com"/><atom:link rel="hub" href="http://superfeedr.com/hubbub"/>		<item>
		<title>Setting your SRV records straight for XMPP</title>
		<link>http://blog.teemu.im/2008/12/14/setting-your-srv-records-straight-for-xmpp/</link>
		<comments>http://blog.teemu.im/2008/12/14/setting-your-srv-records-straight-for-xmpp/#comments</comments>
		<pubDate>Sun, 14 Dec 2008 20:15:38 +0000</pubDate>
		<dc:creator>Teemu Harju</dc:creator>
				<category><![CDATA[XMPP]]></category>
		<category><![CDATA[slicehost]]></category>

		<guid isPermaLink="false">http://blog.teemu.im/?p=194</guid>
		<description><![CDATA[I&#8217;ve noticed that DSN SRV records are something that are not very common knowledge among even some of the really techy people. Well, the reason is probably that most people never need to know what they actually are. I&#8217;m gonna explain them here briefly and show how I set the DNS SRV records for my [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve noticed that DSN SRV records are something that are not very common knowledge among even some of the really techy people. Well, the reason is probably that most people never need to know what they actually are. I&#8217;m gonna explain them here briefly and show how I set the DNS SRV records for my XMPP server hosted at <a href="http://slicehost.com">Slicehost.com</a>.</p>
<p>Ok, so what these DNS SRV records are. If you&#8217;re familiar with the DNS MX record you know that it is used to indicate where is the email server that is hosting a certain domain. For example, I have domain <em>service.com</em> and I&#8217;m running my webserver at <em>www.service.com</em> and my email server is at <em>smtp.service.com</em>. Naturally, I would want my users to have email addresses like <em>user@service.com</em>. Here I would set the DNS MX record to point to <em>smtp.service.com</em> so when email servers communicate with each other they can ask from DNS server that <em>&#8220;where is the email server for domain service.com?&#8221;</em>.</p>
<p>DNS SRV records were specified for a bit more general purpose than MX records that can be used with email only. You might have XMPP server at <em>xmpp.service.com</em> and would like your users have also XMPP address of the format <em>user@service.com</em>. This is how the SRV records for the XMPP look like. This is an example of SRV records I&#8217;ve set for my XMPP server at <em>teemu.im</em>.</p>
<p><code><br />
_xmpp-client._tcp.teemu.im. 82698 IN	SRV	10 0 5222 teemu.im.<br />
_xmpp-server._tcp.teemu.im. 86400 IN	SRV	10 0 5269 teemu.im.<br />
</code></p>
<p>What there actually mean? Well, the <code>_xmpp-client._tcp.teemu.im.</code> line is the line that XMPP clients use to ask from DNS that <em>&#8220;where I can find the XMPP server for domain teemu.im?&#8221;</em>. The DNS server responds that <em>&#8220;the XMPP server can be found from host teemu.im port 5222&#8243;</em>. The other line that has <code>_xmpp-server._tcp.teemu.im.</code> is used by the XMPP servers when they talk to each other using the XMPP server-to-server protocol, similarly as the email servers use the MX records to find out information about each other.</p>
<p>The SRV records can also be used to do &#8220;poor mans load balancing&#8221; by using the priority and weight attributes, but I won&#8217;t go in to that now. Instead, I&#8217;ll show you how you can configure DSN SRV records on <a href="http://slicehost.com">Slicehost.com</a> server. This is because I use Slicehost, but the same principles apply for other hosting providers as well.</p>
<p>First, go to your <a href="http://manage.slicehost.com">SliceManager</a> and login. There choose the &#8220;DNS&#8221; tab and you should see something like this:</p>
<div id="attachment_211" class="wp-caption alignnone" style="width: 570px"><img src="http://blog.teemu.im/wp-content/uploads/2008/12/slicehost_dns_zones-560x83.png" alt="Slicehost&#039;s SliceManager DNS Zones Tab" title="Slicehost&#039;s SliceManager DNS Zones Tab" width="560" height="83" class="size-medium wp-image-211" /><p class="wp-caption-text">Slicehost's SliceManager DNS Zones Tab</p></div>
<p>Now click &#8220;Records&#8221; and then &#8220;new record&#8221;. Fill the form as shown below:</p>
<div id="attachment_214" class="wp-caption alignnone" style="width: 441px"><img src="http://blog.teemu.im/wp-content/uploads/2008/12/slicehost_new_record_xmpp_client.png" alt="Slicehost SliceManager new DNS SRV record for XMPP clients" title="Slicehost SliceManager new DNS SRV record for XMPP clients" width="431" height="474" class="size-full wp-image-214" /><p class="wp-caption-text">Slicehost SliceManager new DNS SRV record for XMPP clients</p></div>
<p>Note that the value in &#8220;Name&#8221; field starts with underscore although it is not visible in the screenshot.</p>
<p>Do the same for the server-to-server protocol, except for the name set <code>_xmpp-server._tcp.domain.com.</code> and for the data use <code>0 5269 domain.com.</code>.</p>
<p>You can use tool called <code>dig</code> for testing your configuration. Type the following line to see if your configuration is correct:</p>
<p><code>dig @ns1.slicehost.net SRV _xmpp-client._tcp.domain.com</code></p>
<p>The result should be:</p>
<p><code><br />
;; ANSWER SECTION:<br />
_xmpp-client._tcp.domain.com. 86400 IN	SRV	10 0 5222 domain.com.<br />
</code></p>
<p>By the way&#8230; when configuring DNS it is good to set the time-to-live value to something relatively small. In case you make mistakes, you don&#8217;t need to wait until the DNS record will be updated. Other good practice is to use the <code>@nameserver.domain.com</code> parameter for <code>dig</code> command so that the entry does not propagate to other DNS servers and you can change it pretty much when ever you want.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.teemu.im/2008/12/14/setting-your-srv-records-straight-for-xmpp/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

