DNS Chat: The LLM That Talks Over DNS TXT Records
Ever feel like your chat applications rely on the same old protocols? HTTP, WebSockets—they get the job done, but where's the creativity? What if you could have a conversation with a large language model without ever establishing a direct connection to an API endpoint?
That's exactly what DNS Chat demonstrates. This clever project implements a ChatGPT-like interface using one of the most fundamental internet protocols: DNS. Instead of sending HTTP requests to an API, it communicates with an LLM entirely through DNS TXT record queries and responses.
What It Does
DNS Chat is a proof-of-concept application that enables text-based conversations with a large language model using DNS as the transport mechanism. When you type a message, the system encodes your query into DNS TXT record lookups. These queries travel through the DNS infrastructure to a custom server that processes your text, generates a response using an LLM, and returns the answer through—you guessed it—more DNS TXT records.
The system handles the back-and-forth of conversation by breaking longer messages into chunks that fit within DNS record size limitations, then reassembling them on the client side.
Why It's Cool
The brilliance of DNS Chat lies in its unconventional approach to a common problem. While most developers would reach for REST APIs or WebSockets to build a chat interface, this project asks: "What if we used the infrastructure that's already powering the internet in a completely different way?"
Some standout aspects:
-
Protocol Creativity: Using DNS for application-layer communication turns conventional thinking on its head. It demonstrates deep understanding of how DNS works and how to leverage it beyond its intended purpose.
-
Infrastructure Reuse: DNS is one of the most reliable and widely supported protocols on the internet. By building on top of it, the project inherits decades of infrastructure optimization and reliability.
-
Stealthy Communication: While not the primary goal, this approach shows how application data could theoretically be hidden within normal-looking network traffic—a concept that might interest security researchers and penetration testers.
-
Educational Value: Beyond being a neat trick, DNS Chat serves as an excellent learning tool for understanding DNS protocol details, including TXT records, query limitations, and chunking strategies for larger payloads.
How to Try It
Ready to chat over DNS? You'll need to set up both the server and client components:
-
Clone the repository:
git clone https://github.com/mneves75/dnschat cd dnschat -
Set up the server: You'll need to configure a DNS server (like PowerDNS) with the included backend script that connects to your LLM of choice.
-
Configure your domain: Point a domain or subdomain to your DNS server and ensure it's handling TXT record queries.
-
Run the client: Use the provided Python client to start chatting:
python dns_chat_client.py --domain your-chat-domain.com
The project includes detailed setup instructions in the repository for both the server configuration and client usage. Since you'll need access to an LLM API (like OpenAI's GPT or a local model), make sure you have the appropriate API keys or model access configured.
Final Thoughts
DNS Chat probably won't replace your production chat applications anytime soon—DNS wasn't designed for low-latency, high-bandwidth conversations. But that's not the point. This project embodies the spirit of creative hacking: taking familiar technology and using it in unexpected ways.
For developers, it's a reminder that sometimes the most interesting solutions come from looking at problems through a different lens. Whether you're interested in network protocols, want to understand DNS at a deeper level, or just appreciate clever technical hacks, DNS Chat is worth exploring. It might even inspire your own unconventional approaches to everyday development challenges.
@githubprojects