# About djbdns server



## hainguyen1402 (Apr 29, 2011)

Dear all,
First of all I want to say sorry about my not good English.
My purpose is building a system include: chat + mail + web web service like Yahoo.com 

I have DNS server using djbdns with domain abc.com IP is 192.168.1.1
a. Chat server â€“ I use ejabberd â€“ with domain xmpp.abc.com and IP is 192.168.1.2
b. Mail server: domain mail.abc.com, IP 192.168.1.3
c. Web server domain http://www.abc.com, IP 192.168.1.4

What I want is 
Client with account xyz@abc.com can use all service chat, web and email
When client log to chat server (port 5222) abc.com will point to xmpp.abc.com; mail server -> mail.abc.com and web -> http://www.abc.com

I read documents and I found out that we should use SRV record but can anybody help me to solve this porblem

Thank you all!


----------



## SirDice (Apr 29, 2011)

What problem? Looks like you already have things working as they should.


----------



## ohauer (Apr 29, 2011)

I guess you want a SRV record for the xmpp service which points to xmpp.abc.com

djbdns entry for this:

```
:_xmpp-client._tcp.abc.com:33:\000\012\000\144\023\304\004xmpp\003abc\003com\000:86400
```
To make it easy for you, use the record builder from anders.com
http://anders.com/projects/sysadmin/djbdnsRecordBuilder/


----------



## hainguyen1402 (May 4, 2011)

Thank ohauer, I did what you showed me but when I test by *telnet abc.com* with port 5222, it makes connection to abc.com with IP 192.168.1.1 not to xmpp.abc.com - IP 192.168.1.2


```
#telnet abc.com 5222
Trying 192.168.1.1...
telnet: connect to address 192.168.1.1: Connection refused
telnet: Unable to connect to remote host
```

Can you make it clearer because I'm newbie with FreeBSD.

Thanks.


----------



## ohauer (May 4, 2011)

I will try to make it clearer ...

The DNS SRV record describes on which machine and port a special service is available.
For normal client connections to your server you do not need DNS SRV records since clients thy can direct use the hostname and port in there configuration.
If you jabber server allows s2s (server to server) communication (for example from jabber.org) you need DNS SRV records.
Say your domain is example.com and someone from another domain wants to chat with you, then the remote jabber server will look for those SRV records to find your jabber server

_jabber._tcp.example.com 
_xmpp-server._tcp.example.com 
_xmpp-client._tcp.example.com

If those entries are set then the remote server can find your jabber machine.
The remote server does something like 
`$ dig _jabber._tcp.example.com any +short`
and get this back

```
10 0 5269 host.example.com.
```
Now the remote server will try to make a connection to host.example.com. on port 5269.

Without SRV records the remote server has no idea on which machine and port your jabber server is running.

Your telnet client is a simple TCP client which does not understand this records for telnet those records are the same like Chinese for me 

Maybe some better explanations and how to build this records.
http://en.wikipedia.org/wiki/SRV_record
http://www.jabberdoc.org/section05#5_7
http://www.zytrax.com/books/dns/ch8/srv.html


----------



## hainguyen1402 (May 5, 2011)

First of all, I want to thank ohauer so much.
Your explanation is very clear for me. My problem is solved.


----------

