Saturday, January 17, 2026

Novel Method for Embedding Digital Images into Text Data via DNS TXT Records

A novel method for storing digital images within Domain Name System (DNS) records has been developed, demonstrating an innovative approach to data storage and retrieval.

This technique leverages DNS TXT records, traditionally used for text verification and configuration information, to store encoded image data across multiple DNS entries.

The approach provides a unique way to host and retrieve images without conventional web servers, opening possibilities for creative data storage solutions in unexpected network infrastructure.

The technique begins by converting image files into hexadecimal format using standard command-line tools.

While the developer notes that “this will not be as efficient as storing the data in base64 format, as this will use 2x the space where base64 would only use 1.33x the file size,” the hex approach proved sufficient for initial proof-of-concept testing.

The fundamental challenge emerged immediately: DNS TXT records have inherent size limitations, preventing the storage of complete image data in a single record.

To overcome this limitation, a Python script was developed to segment image data into 2048-character chunks.

The script creates individual TXT records for each segment, using a systematic naming convention (dnsimg-1, dnsimg-2, etc.) under the target domain.

Critically, an additional record called “dnsimg-count” stores the total number of chunks, enabling any retrieval system to know exactly how many records to request when reconstructing the image.

The implementation through Cloudflare’s DNS management system demonstrated successful propagation of the records, though propagation time proved to be a factor in successful retrieval.

When testing was conducted before complete propagation, the resulting images appeared corrupted due to missing data chunks.

New Technique Embeds Digital Images

The retrieval mechanism employs another Python script utilizing the “dig” command to asynchronously request all image chunks from DNS servers.

The script queries the count record first to determine how many segments to retrieve, then launches parallel threads to fetch all chunks simultaneously.

Once retrieved, the script concatenates the hexadecimal data and converts it back to binary format, reconstructing the original image file.

The developer implemented visual status indicators during retrieval, showing which chunks were successfully loaded and which were still pending or missing.

This process highlighted both the viability of the technique and its current limitations in real-time applications.

Practical Applications Emerge

Testing revealed clear boundaries to the approach, particularly when attempting to store larger images.

The developer encountered errors when trying to store images exceeding 1MB, noting, “Not sure if this is a Cloudflare limit or a wider rule.”

Despite this constraint, the technique successfully stored and retrieved smaller images across multiple domains including “asherfalcon.com” and “containerback.com.”

To demonstrate practical application, a web-based tool was created allowing users to retrieve images stored in DNS records by simply entering a domain name.

This tool enables anyone to experiment with the technique, potentially extending the protocol to their own domains using the publicly available scripts.

While primarily experimental, this DNS-based image storage technique demonstrates creative repurposing of existing internet infrastructure and could inspire new approaches to distributed data storage and covert information sharing.

Find this Story Interesting! Follow us on LinkedIn and X to Get More Instant Updates.

Ethan Brooks
Ethan Brooks
Ethan Brooks is a Senior cybersecurity journalist passionate about threat intelligence and data privacy. His work highlights cyber attacks, hacking, security culture, and cybercrime with The Cyber News.

Recent News

Recent News