DNSChat is a React Native (Expo dev-client) app that sends short chat prompts as
DNS TXT queries (default DNS server: llm.pieter.com). The app includes:
- A native DNS TXT resolver module for iOS/Android (
modules/dns-native/) - JavaScript fallback transports (UDP/TCP) for constrained networks
- An in-app Logs screen to inspect attempts, failures, and fallbacks
User prompts are validated and sanitized into a single DNS label (RFC 1035
constraints) before building a query name. Practical constraints (see
modules/dns-native/constants.ts):
- Prompts are capped at 120 characters before sanitization (hard fail, no silent truncation)
- DNS labels are capped at 63 characters after sanitization
TXT responses are parsed as either:
- Plain TXT records (concatenate non-empty records), or
- Multipart
n/N:segments that must form a complete sequence
The transport order used by src/services/dnsService.ts is:
- Native DNS (iOS/Android native module)
- UDP (JavaScript transport via
react-native-udp) - TCP (DNS-over-TCP via
react-native-tcp-socket) - Mock (optional development fallback)
Web preview uses the Mock path by default because browsers cannot do raw DNS on port 53.
Prereqs:
- Node.js 18+
- iOS: Xcode 15+ (macOS only), iOS 16+ device/simulator
- Android: Java 17 + Android SDK
Install:
git clone https://github.com/mneves75/dnschat.git
cd dnschat
bun installRun:
# Dev server (Expo dev-client)
bun run start
# iOS
bun run ios
# Android (auto-selects Java 17 when available)
bun run android
# Web preview (uses Mock DNS)
bun run webNotes:
- iOS simulator builds work out of the box; device builds require you to pick your own signing team in Xcode (the repo keeps
DEVELOPMENT_TEAMempty).
# Quick DNS check (no React Native runtime required)
node test-dns-simple.js "test message"
node test-dns-simple.js "test message" --local-server
# Full harness (builds scripts/ ts -> js, then runs UDP/TCP transports)
bun run dns:harness -- --message "test message"
bun run dns:harness -- --message "test message" --local-server
# Debug output artifacts
bun run dns:harness -- --message "test" --json-out harness-output.json --raw-out raw-dns.bin# Lint (ast-grep rules)
bun run lint
# Unit tests
bun run test
# Keep Expo iOS pods aligned with installed node_modules (iOS)
bun run verify:ios-pods
# Sanity checks for Android tooling/device expectations
bun run verify:android
# Sync app + native module versions (use :dry to preview)
bun run sync-versions
bun run sync-versions:dry
# CocoaPods cleanup helpers
bun run fix-pods
bun run clean-iosThis repo installs a pre-commit hook that blocks commits when the ast-grep lint fails.
Mechanism:
bun installrunsbun run preparepreparerunsscripts/install-git-hooks.js- that script writes
.git/hooks/pre-committhat runsverify:ios-pods,lint(ast-grep), and unit tests
If you do not want repo-managed hooks, remove .git/hooks/pre-commit locally.
docs/README.md(index)docs/INSTALL.mddocs/architecture/SYSTEM-ARCHITECTURE.mddocs/troubleshooting/COMMON-ISSUES.mddocs/technical/DNS-PROTOCOL-SPEC.md
- DNS is observable infrastructure. Do not send secrets or personal data.
- DNS servers are validated/whitelisted (see
modules/dns-native/constants.ts). - Store submission credentials are not committed. Keep
eas submit/App Store Connect identifiers local (do not add them toeas.json).
MIT. See LICENSE.