A lightweight DNS-based message broker
Project description
TXTpresso
TXTpresso is an unconventional and experimental project aimed at exploring the possibilities of using DNS protocol and TXT records with zero-second TTL for lightweight API-like data communication. Welcome to the geeky side of internet protocols!
Goal
The goal of TXTpresso is to use the DNS protocol's unique features to create a lightweight, fast, and potentially harder-to-detect communication system compared to traditional HTTP APIs.
Concept
Using DNS TXT records and UDP, TXTpresso offers simple and swift communication methods compared to the overhead of HTTP requests, headers, and JSON payloads. By using unique lookups, such as test${UTIME}.domain, TXTpresso bypasses some caching issues, though users should be cautious of the potential impact on DNS traffic and server load.
Use Cases
- Bypassing firewalls or restrictions: By using DNS instead of HTTP APIs, this "under-the-radar" method might allow for communication in scenarios where traditional internet access is limited or blocked.
- Lightweight communication: If the emphasis is on simplicity and speed rather than robustness, using DNS lookups and UDP might keep things fast and lightweight compared to a full-blown HTTP API.
- Novel applications or hacks: As a fun, experimental project, you could come up with neat applications that take advantage of the DNS protocol's unique characteristics.
Methods
GET
TXTpresso's GET method is is using the concept of utilizing subdomains to represent queries or endpoints. By sending a DNS query for a TXT record on a specific subdomain (like time.domain
), you essentially request data associated with that subdomain. The server, in turn, processes the query and sends back the corresponding data in the TXT record.
Example: To query the current time, use the dig
command to search for a TXT record on time.domain
:
dig @txtpresso.server.com +short txt time.txtpresso
POST
TXTpresso's POST method relies on BASE64-encoding the data you want to send and embedding it as part of a subdomain in a DNS query. This approach essentially transforms the subdomain into a carrier of your data payload. Upon receiving the query, the server decodes the information from the subdomain and processes it accordingly.
Example: Encode your data (limited to 512 bytes) in a DNS-friendly format, such as Base64, and send it as a subdomain for a DNS query.
dig @txtpresso.server.com +short a c3VwZXJ0cm91cGVyCg.post.txtpresso
Caveats
Be mindful of some limitations when using TXTpresso:
- Increased DNS traffic and potential server load.
- Caching complications, depending on unique lookups.
- Limitations in data size - a maximum of 512 bytes.
- Potential latency and packet loss with UDP.
Reminder
This experimental project is intended for educational purposes and to demonstrate the unconventional application of the DNS protocol. Always consider the broader impact on internet infrastructure and use TXTpresso responsibly.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for TXTpresso-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d29f5133a922b481b5adccc2347a4e18f2595ca53db940823f73654cbc97aed3 |
|
MD5 | 6445f2a06f6cc9b5b524ac88ff4d2108 |
|
BLAKE2b-256 | dc0a5a2e44b0ee9b497a1687935da5deeebe6501260d5cb8789aa066e9cb3e0f |