# Internal PBX server with remote clients

> Let office users and remote workers connect to an on-premises PBX with the same hostname, using a public DNS record, port forwarding and an internal DNS override.

URL: https://webrtcclient.com/guides/internal-pbx-remote-clients/

A common setup: the company runs a PBX in the office, while some employees work from home or on the road. With one hostname and *split DNS*, both groups connect to the same PBX — office users over the LAN, remote users over the internet.

## Setup

1. **Create a public hostname** pointing to the office's public IP address, e.g. `webclient.company.com  A  123.123.123.123`.
2. **Get a TLS certificate** for that (sub)domain and install it on the PBX.
3. **Forward the websocket port** on the router to the PBX, e.g. `123.123.123.123:8089 → 192.168.1.100:8089` (plus the RTP range for media).
4. **Add an internal DNS record** for the same name pointing to the private IP, e.g. `webclient.company.com → 192.168.1.100`.

## How it works

| Where the user is | DNS answer | Connection |
|---|---|---|
| Outside the office | `123.123.123.123` (public) | Via the internet and the port forward |
| In the office | `192.168.1.100` (private) | Directly over the LAN |

Because the hostname is the same, the certificate is valid in both cases and users don't have to change anything.

**Important:**
Office computers must use the router's (or your internal) DNS servers. If they use a public DNS resolver such as 8.8.8.8, they receive the public IP instead.

Tip: you can also create the internal record with a DNS rewrite in Pi-hole or AdGuard.
