Tony's ramblings on Open Source Software, Life and Photography

xmpp

Creating SRV Records in PowerDNS

PowerDNS is a great little DNS server, especially if you want to use OpenLDAP for the backend. Unfortunately some of it's features are not well documented. That includes creating SRV records when using the "tree" structure of LDAP storage.

If you're using the tree structure for PowerDNS, you already have something like the following:

dc=yourdomain,dc=com,ou=powerdns,dc=ldapdomain

This shows in a tree view something like:

dc=ldapdomain
  ou=powerdns
    dc=com
      dc=yourdomain
        dc=server1
        dc=server2
...

If you want to use SRV records to let your DNS server tell apps where services are located, you must create the following branch structure:

dc=ldapdomain
  ou=powerdns
    dc=com
      dc=yourdomain
        dc=_tcp
          dc=_xmpp-client
          dc=_xmpp-server
        dc=server1
...

Notice you need a tree branch under "yourdomain" that is for the _tcp protocol. For udp services you'll need a tree branch called "_udp" obviously.

From there, you create the actual sRVRecords for the services such as _xmpp-client and _xmpp-server

Set the associatedDomain attribute to "_xmpp-client._tcp.yourdomain.com", etc., and set the sRVRecord to "[weight] [priority] [port] [target]".

An example LDIF would look like:

dn: dc=_tcp,dc=example,dc=com,ou=powerdns,dc=ldapdomain