TeamSpeak TSDNS with Regex matching and MySQL/SQLite/PostgreSQL/Redis storage backends.
6.7K
Enhanced TeamSpeak TSDNS server with regex matching, multiple storage backends, and a management API.
This project is a protocol-compatible implementation and is not affiliated with TeamSpeak Systems GmbH.
* and *.domain).reg: prefix).ts-*-server.com).$PORT placeholder substitution (via port 0).NORESPONSE support (empty target list).The easiest way to install the latest tsdns binary on Linux, macOS, or FreeBSD:
curl -fsSL https://raw.githubusercontent.com/HoneyBBQ/tsdns/main/scripts/install.sh | sh
Download the .deb, .rpm, or .apk package from the Releases page.
Debian / Ubuntu:
sudo dpkg -i tsdns_*.deb
sudo systemctl enable --now tsdns
CentOS / RHEL / Fedora:
sudo rpm -ivh tsdns_*.rpm
sudo systemctl enable --now tsdns
Alpine:
sudo apk add --allow-untrusted tsdns_*.apk
Note: Native packages automatically create a
tsdnsuser, set up a systemd service, and generate a random API token in/etc/tsdns/config.yaml.
docker run -d --name tsdns \
-p 41144:41144 \
-p 8080:8080 \
-e TSDNS_API_TOKEN=your-secret-token \
-e TSDNS_STORAGE_DSN=sqlite:/data/tsdns.sqlite \
-v tsdns-data:/data \
honeybbq/tsdns:latest
Requires Go 1.25 or later.
go install github.com/honeybbq/tsdns/cmd/tsdns@latest
The protocol server is published as a separate module with no third-party dependencies. Applications that provide their own RecordRepository can use the core without downloading the CLI, HTTP API, metrics, or storage backend dependencies.
go get github.com/honeybbq/tsdns/[email protected]
import tsdns "github.com/honeybbq/tsdns/core"
server, err := tsdns.NewServer("0.0.0.0").
WithRepository(repository).
Build()
repository must implement tsdns.RecordRepository. Logging and metrics use the standard library slog.Logger and the small tsdns.Metrics interface.
Configure via config.yaml or environment variables.
tsdns:
listen: "0.0.0.0:41144"
cache_refresh_interval: "30s"
api:
listen: "0.0.0.0:8080"
token: "my-token"
storage:
dsn: "sqlite:./tsdns.sqlite"
Records can be managed via the CLI or the REST API.
CLI examples:
# Add a simple record
tsdns records add --domain ts.example.com --target 1.2.3.4:9987 --token my-token
# Add multiple targets with $PORT (port 0)
tsdns records add --domain *.example.com --target "1.2.3.4:0 [2001:db8::1]:9987" --token my-token
# Add a regex record
tsdns records add --domain "reg:^ts\d+\.example\.com$" --target "1.2.3.4:9987" --token my-token
API example:
curl -X POST http://localhost:8080/api/v1/records \
-H "Authorization: Bearer my-token" \
-d '{
"domain": "ts.example.com",
"targets": ["1.2.3.4:9987", "5.6.7.8:0"]
}'
printf "ts.example.com\n" | nc localhost 41144
Configurable via environment variables:
| Variable | Default | Description |
|---|---|---|
TSDNS_LISTEN | 0.0.0.0:41144 | TSDNS TCP listen address |
TSDNS_CACHE_REFRESH_INTERVAL | 30s | Background cache refresh interval |
TSDNS_API_LISTEN | 127.0.0.1:8080 | Admin API TCP listen address |
TSDNS_API_SOCKET | /tmp/tsdns.sock (Docker) | Unix domain socket path for local management |
TSDNS_API_TOKEN | empty | Shared secret for API authentication |
TSDNS_STORAGE_DSN | sqlite:./tsdns.sqlite | Storage backend connection string |
Set the backend via TSDNS_STORAGE_DSN:
| Backend | DSN Format |
|---|---|
| SQLite | sqlite:<path> |
| PostgreSQL | postgres://<user>:<pass>@<host>:<port>/<db> |
| MySQL | mysql://<user>:<pass>@<host>:<port>/<db> |
| Redis | redis://:<pass>@<host>:<port>/<db> |
| Method | Endpoint | Description |
|---|---|---|
GET | /healthz | Health check |
GET | /api/v1/records | List records |
POST | /api/v1/records | Create/Update record |
GET | /api/v1/records/{domain} | Get record |
DELETE | /api/v1/records/{domain} | Delete record |
cmd/tsdns/: Application entry point.internal/: Core implementation details (API, CLI, config, storage).repository/: Database-specific driver implementations.record.go: Core domain model and repository interface.MIT License. See LICENSE.
Content type
Image
Digest
sha256:a80115e5d…
Size
6.9 MB
Last updated
about 21 hours ago
docker pull honeybbq/tsdns:sha-aa62b29