STUN server
also: STUN, Session Traversal Utilities for NAT
A STUN server is a network service that helps devices behind NAT firewalls discover their public IP address and port number for peer-to-peer communication.
STUN (Session Traversal Utilities for NAT) is a protocol and server type that solves a common problem: devices on private networks can't directly tell what their public-facing address is, making peer-to-peer connections difficult. A STUN server sits on the public internet and responds to queries from clients, revealing the client's external IP and port as seen from the internet.
When a Linux application (like a VoIP client or video conferencing tool) needs to establish a direct connection with another peer, it first contacts a STUN server and asks "what's my public address?" The server responds with the source IP and port of the incoming request, which the client then shares with its peer.
For example: a user behind a home router runs a peer-to-peer application that queries stun.l.google.com:19302. The STUN server responds: "I see you at 203.0.113.42:54321." The application then tells its peer to reach it at that address. STUN only handles discovery; for actual NAT traversal of complex firewalls, TURN servers are often needed as a fallback.