{"id":16835452,"url":"https://github.com/defuse/dnsfs","last_synced_at":"2025-04-11T05:04:10.597Z","repository":{"id":15533878,"uuid":"18268526","full_name":"defuse/dnsfs","owner":"defuse","description":"Host files with DNS","archived":false,"fork":false,"pushed_at":"2016-03-01T16:48:54.000Z","size":556,"stargazers_count":32,"open_issues_count":1,"forks_count":5,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-02-03T14:52:02.286Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/defuse.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-03-30T16:50:01.000Z","updated_at":"2024-09-06T19:30:12.000Z","dependencies_parsed_at":"2022-09-10T11:31:47.199Z","dependency_job_id":null,"html_url":"https://github.com/defuse/dnsfs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/defuse%2Fdnsfs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/defuse%2Fdnsfs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/defuse%2Fdnsfs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/defuse%2Fdnsfs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/defuse","download_url":"https://codeload.github.com/defuse/dnsfs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239526541,"owners_count":19653559,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-13T12:10:21.953Z","updated_at":"2025-02-18T18:30:57.885Z","avatar_url":"https://github.com/defuse.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"dnsfs\n=====\n\nThis is a script for hosting and downloading a static set of files over DNS\n*without using a custom DNS server*. If you give `dnsfs.rb` a path to\na directory, it will create BIND-compatible TXT entries for hosting the files\ninside. If you give `dnsfs.rb` a domain name, it will show you the list of\nhosted files and ask which one you want to download.\n\nHow fast is it? I downloaded a 568K file from my nameserver in 293 seconds... so\nabout 1981 bytes/second. Of course it depends on the RTT, and it can probably be\nsped up a lot by sending requests in parallel (this script doesn't).\n\nNOTE: I'm pretty sure something like this has been done before... I just wanted\nto write it myself and couldn't find the reference. Please let me know of\nsimilar things!\n\n**Related Work**\n\n- http://www.aldeid.com/wiki/File-transfer-via-DNS\n\nExamples\n========\n\nDownloading\n-----------\n\nNote: Intermediate nameservers may cache your requests. Please be respectful and\nquery the authoratative nameserver directly using the `--nameserver` option!\n\n    $ ruby dnsfs.rb --download --nameserver dnsfs.defuse.ca dnsfs.defuse.ca\n    1. manifesto.txt (size: 3880 bytes)\n    2. longcat.jpg (size: 580516 bytes)\n    Which one?\n    1\n    .....................\n    File written to /tmp/manifesto.txt.\n\nGenerating\n----------\n\n    $ ruby dnsfs.rb --generate test\n    f1info.dnsfs IN TXT \"Name: foo.txt / Size: 31\"\n    f1p1.dnsfs IN TXT \"VGhpcyBpcyAKYSBmaWxlCm5hbWVkCmZvby50eHQhCg==\"\n    f1p2.dnsfs IN TXT \"~EOF~\"\n    f2info.dnsfs IN TXT \"Name: bar.txt / Size: 558\"\n    f2p1.dnsfs IN TXT \"VGhpcyBpcyAKYSBmaWxlCm5hbWVkCmJhci50eHQhClRoaXMgaXMgCmEgZmlsZQpuYW1lZApiYXIudHh0IQpUaGlzIGlzIAphIGZpbGUKbmFtZWQKYmFyLnR4dCEKVGhpcyBpcyAKYSBmaWxlCm5hbWVkCmJhci50eHQhClRoaXMgaXMgCmEgZmlsZQpuYW1lZApiYXIudHh0IQpUaGlzIGlzIAphIGZpbGUKbmFtZWQKYmFyLnR4dCEKVGhp\"\n    f2p2.dnsfs IN TXT \"cyBpcyAKYSBmaWxlCm5hbWVkCmJhci50eHQhClRoaXMgaXMgCmEgZmlsZQpuYW1lZApiYXIudHh0IQpUaGlzIGlzIAphIGZpbGUKbmFtZWQKYmFyLnR4dCEKVGhpcyBpcyAKYSBmaWxlCm5hbWVkCmJhci50eHQhClRoaXMgaXMgCmEgZmlsZQpuYW1lZApiYXIudHh0IQpUaGlzIGlzIAphIGZpbGUKbmFtZWQKYmFyLnR4dCEKVGhpcyBp\"\n    f2p3.dnsfs IN TXT \"cyAKYSBmaWxlCm5hbWVkCmJhci50eHQhClRoaXMgaXMgCmEgZmlsZQpuYW1lZApiYXIudHh0IQpUaGlzIGlzIAphIGZpbGUKbmFtZWQKYmFyLnR4dCEKVGhpcyBpcyAKYSBmaWxlCm5hbWVkCmJhci50eHQhClRoaXMgaXMgCmEgZmlsZQpuYW1lZApiYXIudHh0IQpUaGlzIGlzIAphIGZpbGUKbmFtZWQKYmFyLnR4dCEK\"\n    f2p4.dnsfs IN TXT \"~EOF~\"\n    f3info.dnsfs IN TXT \"~EOL~\"\n\nDownloading Without Ruby\n------------------------\n\nThe naming convention makes it easy to download a file with a standard `/bin/sh`\ncommand:\n\n    for i in `seq 21`; do host -t TXT f1p$i.dnsfs.defuse.ca|cut -d '\"' -f 2|base64 --decode; done|less\n\nAlternatively, using `dig`:\n\n    for i in `seq 21`; do dig f1p$i.dnsfs.defuse.ca TXT|grep TXT|grep '\"'|cut -d '\"' -f 2|base64 --decode; done|less\n\nAll you have to do is replace `f1` with the file number you want and `seq 21`\nwith the number of parts in the file (the ceiling of the file size divided by\n189).\n\nHow It Works\n============\n\nFor each file K in 1..N, there are a set of TXT entries:\n\n- f\u003ci\u003eK\u003c/i\u003einfo: File K's name and size.\n- f\u003ci\u003eN+1\u003c/i\u003einfo: End of list marker: `~EOL~`\n- f\u003ci\u003eK\u003c/i\u003ep\u003ci\u003eP\u003c/i\u003e: Part *P* of file *K* base64-encoded. Last one is `~EOF~`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdefuse%2Fdnsfs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdefuse%2Fdnsfs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdefuse%2Fdnsfs/lists"}