TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Storing ASCII art in the DNS

39 pointsby fcambusover 11 years ago

4 comments

colmmaccover 11 years ago
TXT records are bizarre things. Each TXT record is actually a variably sized list of variably sized character strings. There can safely up to 127 characters per string (there&#x27;s ambiguity about whether the 8-bit length field is signed or not) and the total size of the whole record is up to 64k. That should be plenty for ascii art.<p>Order is guaranteed for these character strings; at the wire level they are a contiguous blob. With the increasing adoption of SPF though, it&#x27;s also increasingly common for implementations to preserve the order of the TXT records in a multi-record record set; so that the records can be concatenated in order to make a meaningful SPF string.<p>On the wire the records look like this;<p><pre><code> name type=TXT class=IN TTL=NN RDLENGTH=MM [length]some text[length]more text name type=TXT class=IN TTL=NN RDLENGTH=MM [length]even more text </code></pre> which should be concatenated by readers (e.g. SPF implementations) to form a logical string like &quot;some textmore texteven more text&quot;.<p>so if you use multiple records, you&#x27;re really just putting arrays on top of arrays. It&#x27;s usually best to stuff things into one record though, so that you don&#x27;t have to risk an intermediate resolver re-ordering things.<p>Here&#x27;s one of the earliest records ever created in Route 53, to test things out;<p><pre><code> dig +short TXT bradm.com @ns-323.awsdns-40.com | sed $&#x27;s&#x2F;\&quot; \&quot;&#x2F;\\\n&#x2F;g&#x27;</code></pre>
评论 #7185728 未加载
jffryover 11 years ago
Step 1: Encrypt your data<p>Step 2: base64encode it and store it in DNS records<p>Step 3: Data is propagated and cached globally<p>Step 4: ???<p>Step 5: Profit!
评论 #7185473 未加载
jonny_ehover 11 years ago
I just tried the command but it looks like the lines came back out of order.<p>The order seems random each time, I suppose I could keep trying until it works.
评论 #7185389 未加载
评论 #7185402 未加载
dblockover 11 years ago
Brilliant.<p>dig @8.8.8.8 naptr ascii.artsy.net +short | sort