For some reason if you look up how to do this you will find endless posts telling you it’s completely impossible and will never work. I literally have no idea why people say this since it just is not true. I used to do this for a wiki service that was hard coded to only respond on port 5000 and it worked fine, I also use this to this day for Minecraft servers.
Here is how I do this in Cloudflare:
- Create a new A record, enter whatever subdomain name you’d like.
- Create a new SRV record:
- Name: _sip._tcp.subdomainname
- Priority: 0
- Weight: 0
- TTL: Auto
- Port: <port you’re using>
- Target: subdomain.domain.com
- You’re done!
Here’s an example Minecraft one:
