> ## Content Index
> Fetch the complete content index at: https://www.process-one.net/llms.txt
> Use this file to discover other available public pages before exploring further.

# STUN server in ejabberd
- URL: https://www.process-one.net/blog/stun-server-in-ejabberd/
- Published: 2009-08-16T22:00:00.000Z
- Updated: 2024-09-24T09:01:46.000Z
- Description: ejabberd has gained a STUN server, helping Jingle communications.
- Author: ProcessOne

[STUN](https://en.wikipedia.org/wiki/STUN?ref=process-one.net) stands for Simple Traversal Utilities for NAT. And [NAT](https://en.wikipedia.org/wiki/Network%5Faddress%5Ftranslation?ref=process-one.net) stands for Network Address Translation.

NAT devices, such as routers and firewalls, translate a private IP address into a public IP address. When you are not directly connected to the internet, but you are in a LAN behind a NAT, you can only know your private LAN address. Thus a Jingle contact of yours may not be able to join you.

STUN is a protocol designed to discover the mapping between your public and private address. A STUN server is located on the public internet, thus knowing the public addresses. Then if you are behind a NAT and want to initiate a Jingle session with a contact, you can discover and send your public address to this contact.

ejabberd’s STUN server will help Jingle communications to happen when parties are separated by a NAT, by providing a public service for IP addresses and ports discovery.

You can get it at:

![](https://www.process-one.net/content/images/2024/09/1-5.jpg)

The documentation is here: [https://svn.process-one.net/ejabberd/trunk/doc/guide.html](https://svn.process-one.net/ejabberd/trunk/doc/guide.html?ref=process-one.net#htoc29)

Example configuration:

![](https://www.process-one.net/content/images/2024/09/2-4.jpg)

Example DNS SRV configuration:

![](https://www.process-one.net/content/images/2024/09/3-4.jpg)