Component Instance: dnsrv

The dnsrv component, described by the configuration XML shown in Example 4-16 and shown in diagram form in Figure 4-12, provides routing logic and name resolution for packets that are destined for a nonlocal component, in other words, for a component that is running on another Jabber server.[7]

Diagram view of dnsrv component instance
Figure 4-12. Diagram view of dnsrv component instance
Example 4-16. jabber.xml configuration for the dnsrv component instance

<service id="dnsrv">

  <host/>

  <load>
    <dnsrv>./dnsrv/dnsrv.so</dnsrv>
  </load>

  <dnsrv xmlns="jabber:config:dnsrv">
  	<resend service="_jabber._tcp">s2s</resend>
  	<resend>s2s</resend>
  </dnsrv>

</service>

Once started, the component forks to spawn a child process that services the actual name resolution requests and the route determination. The component and its child communicate with a simple XML stream within which hostnames are passed to the child process in a “query” tag:

<host>update.jabber.org</host>

and answers are passed back in the form of attribute additions to the original query tag:

<host ip='208.245.212.100' to='s2s'>update.jabber.org</host>



[7] Or, for example, on a server offering another IM service (this is planned for the future).

Get Programming Jabber now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.