Skip to content

nille/dnspaste

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

📋 dnspaste

⚠️ Work in progress

A globally distributed, zero-infrastructure, universally readable key-value store — as long as your values are small and you don't care about write performance, privacy, or being a responsible internet citizen.

It's a pastebin that stores data in DNS TXT records via Cloudflare. Text is base64-encoded, chunked into 180-byte pieces, and stored as TXT records under your domain. Anyone with dig can read your pastes.

How it works

echo "Hello, DNS!" | dnspaste push
# ✓ Paste uploaded
#   ID:     a1b2c3d4
#   Chunks: 1

dnspaste pull a1b2c3d4
# Hello, DNS!

# Anyone can read it with dig:
dig a1b2c3d4.0000.paste.yourdomain.com TXT +short

Setup

  1. Create ~/.dnspaste.json:
{
  "apiToken": "your-cloudflare-api-token",
  "zoneId": "your-zone-id",
  "domain": "paste.yourdomain.com"
}
  1. Install and build:
npm install
npm run build
  1. Use:
# Pipe text
echo "secret message" | dnspaste push

# From file
dnspaste push --file notes.txt

# Custom ID
echo "hello" | dnspaste push --id mykey

# Retrieve
dnspaste pull mykey

# Delete
dnspaste rm mykey

# Show raw dig commands
dnspaste dig mykey

Commands

Command Description
push Upload text to DNS TXT records
pull <id> Download and reassemble a paste
rm <id> Delete all DNS records for a paste
dig <id> Show the raw dig commands to read without dnspaste

DNS record structure

{id}.meta.paste.domain.com    TXT "chunks=3"
{id}.0000.paste.domain.com    TXT "SGVsbG8sIH..."
{id}.0001.paste.domain.com    TXT "dG8gRE5TIS..."
{id}.0002.paste.domain.com    TXT "Cg=="

Requirements

  • Node.js 18+
  • A Cloudflare-managed domain
  • Cloudflare API token with DNS edit permissions

About

Pastebin backed by DNS TXT records via Cloudflare

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors