How do I redirect a subdomain to ts3 server using apache2?

Hi there!

I have a small group of friends who would like to communicate trough TeamSpeak. I own a VPS that I rent out for my web project and for hosting I use Apache2 service. I have a domain and I can freely create A records for my subdomains. The only problem is - I cant make the apache to redirect to (aka. example IP). I tried with Proxies, but apache doesn’t recognize ts3server:// as a valid handler.

Is there any other way I can achieve this with apache?

ts3server:// is only used for sharinf connection information between clients.
It is NOT used for connecting to a server.
A server uses UDP for the voice connection.
UDP does not use those protocols known for TCP.

If you host your TS server on the same host as the Apache server there is neither need for a subdomain, nor for a (reverse) proxy.

If the TS ans Apache server run on different hosts with different IPs you will need either a reverse proxy for the default domain, OR a subdomain leading to the different host.

So how does it work then?

Assuming both your apache and TS server runs on .
You simply need to open the TS server port UDP (default 9987/udp) through the firewall.

Assuming apache runs on and TS on and you want to use a subdomain.
Simply set the A record for the subdomain to point to and allow 9987/udp through the firewall of .

Assuming apache runs on and TS on and you want to use the same domain.
Set up a reverse proxy in apache to listen to port 9987/udp and redirect / stream the traffic to the same port on . Both machines need to have port 9987/udp opened in the firewall.

Even if port 9987/udp is technically enough, it is recommended to also allow / forward the ports found here:


Thank you for your answer!

My goal here is to have users use my domain instead of IP. I am not sure how to do it. I tried to create a virtual host with proxy but upon inputting domain name in TS3 client, it did not connect. With IP, however, it connected.

My question is: How to create a subdomain that ts3 can actually connect to?

Ok, let’s look at how the client handles a new (basic) connection:
In this example the domain is ya[...].ha[...].TLD
The A record for ya[...].ha[...].TLD points to 61.[...]
The A record for ha[...].TLD points to 85.[...]

Now we can see that the domain is resolved but the subdomain prioritized.
When you now say, you can connect to e.g. but not to the problem should be with the record.
Things to ensure:

  • actually points to (nslookup
  • If the server is not on the default port you need
    • a SRV record OR
    • still specify the port even with a domain (

Just set up an SRV RR and call it a day.

Go to the control panel of your domain registrar and setup “DNS record A” to make it redirect traffic to the ip adress of your server on which you have TS3 server.