← Back to Simple IP Tools

Run your own HTTPS relay

sipt-relay · for the DNSSEC tool of Simple IP Tools on iOS and Android

Coming soon The DNSSEC tool and its HTTPS relay option arrive in version 1.2 of the app. You can already install and test your own relay.

Why a relay?

The DNSSEC tool talks directly to the root and authoritative DNS servers (port 53), without any intermediate resolver. Many mobile operators, and some public or corporate Wi-Fi networks, block or intercept these queries. On those networks the app can send its queries through an HTTPS relay instead: each query travels encrypted to the relay, which forwards it unchanged to the DNS server chosen by the app and returns the raw answer.

The relay is a transport only. The app still walks the DNS tree from the root servers and verifies every DNSSEC signature on the device, against its built-in trust anchors: a relay can make an analysis fail, but it cannot make a domain appear "Secure".

The demonstration relay

The app is set up with relaydemo.simpleiptools.com, a demonstration relay operated by the developer. It limits the number of queries it accepts, so a heavy use can be slowed down or refused for a minute. It keeps no logs (see the privacy policy). For regular use, or to keep the domain names you analyze to yourself, run your own relay: a small Linux server is enough.

Downloads

sipt-relay is a single static program written in Go, with no dependency outside the Go standard library.

  • sipt-relay-linux-amd64 — Linux x86_64 (static binary)
  • sipt-relay-linux-arm64 — Linux ARM64 (static binary)
  • sipt-relay-src.tar.gz — Go source code, tests, build script, Dockerfile, systemd service and README
  • SHA256SUMS — SHA-256 checksums of the files above

Check a download before installing it:

sha256sum -c --ignore-missing SHA256SUMS

Requirements

  • A Linux server (x86_64 or ARM64) with a public IP address, for example a small VPS.
  • A DNS name for the relay, for example relay.example.com, with an A record (and AAAA if the server has IPv6) pointing to the server.
  • A TLS certificate for that name, with its full chain (server certificate first, then the intermediate certificates of the authority).
  • Inbound 443/tcp open; outbound DNS (53/udp and 53/tcp) allowed, which is the default.

Install on Linux with systemd

The commands below are for Ubuntu or Debian; adapt the package and user commands to your distribution.

1. Program

sudo install -m 0755 sipt-relay-linux-amd64 /usr/local/bin/sipt-relay

2. System user and certificate

sudo groupadd --system sipt-relay
sudo useradd --system --no-create-home --shell /usr/sbin/nologin --gid sipt-relay sipt-relay
sudo install -d -m 0750 -o root -g sipt-relay /etc/sipt-relay
cat server.crt intermediate.crt | sudo tee /etc/sipt-relay/fullchain.pem > /dev/null
sudo install -m 0640 -o root -g sipt-relay server.key /etc/sipt-relay/privkey.pem
sudo chown root:sipt-relay /etc/sipt-relay/fullchain.pem
sudo chmod 0640 /etc/sipt-relay/fullchain.pem

A renewed certificate is picked up automatically within a minute (or at once with sudo systemctl reload sipt-relay). If the new files are invalid, the relay keeps the previous certificate and logs the error.

3. Access token (optional, recommended for a private relay)

openssl rand -hex 32 | sudo tee /etc/sipt-relay/token > /dev/null
sudo chown root:sipt-relay /etc/sipt-relay/token
sudo chmod 0640 /etc/sipt-relay/token

Then add -token-file /etc/sipt-relay/token to the ExecStart line of the service file.

4. Service

The service file is in the source archive (deploy/sipt-relay.service).

sudo install -m 0644 deploy/sipt-relay.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable --now sipt-relay
systemctl status sipt-relay

The service runs as the unprivileged sipt-relay user (no shell, no home directory), with only the right to bind port 443, a read-only file system and a restricted set of system calls.

5. Firewall and check

sudo ufw allow 443/tcp
curl https://relay.example.com/health

The health check answers ok. You can then test the TLS configuration on SSL Labs (expected grade: A+).

Options

  • -listen — address to listen on (default :443)
  • -cert, -key — certificate chain and private key in PEM
  • -token-file — file holding the access token, sent by the app as Authorization: Bearer <token>
  • -rate, -burst — queries per minute and per client (default 60), and queries a client may send at once (default 120); IPv6 clients are grouped by /64
  • -concurrency — maximum queries in flight to DNS servers (default 256)
  • -no-ipv6 — for servers without IPv6 connectivity: IPv6 targets are refused at once, so the app skips them instead of waiting

Use it in the app

Open the DNSSEC tool (in the Tools tab on iOS, in the DNS & Domains menu on Android), then the connection button. Choose HTTPS relay, enter the address of your relay (https://relay.example.com) and, if you set one, the access token. Test Relay checks the relay with a real query to a root server. The token is stored in the secure storage of your device (iOS Keychain, Android Keystore). The relay mode lasts until the app is closed; every launch starts in direct mode.

Security and privacy

  • Only single-question, non-recursive standard DNS queries are forwarded: the relay cannot be used as an open resolver or to send arbitrary data.
  • Only public unicast addresses can be reached: private, loopback, link-local, CGNAT, multicast and reserved ranges are refused, so the relay cannot reach the server's own network.
  • Nothing about clients is logged: no query, domain name or IP address. Only startup, certificate reloads and configuration errors reach the system journal.
  • TLS 1.3 only, HSTS, strict HTTP timeouts.

Build from source

Requires Go 1.27 or later.

tar -xzf sipt-relay-src.tar.gz
cd sipt-relay
go test ./...
./build.sh    # dist/sipt-relay-linux-amd64, dist/sipt-relay-linux-arm64, SHA256SUMS

The archive also contains a Dockerfile for those who prefer a container; see its README.

Questions

Write to [email protected].

Home · Privacy Policy · Support