{"title":"Your Domain As Your Bluesky Handle, No DNS Needed","html_url":"https://deallocatedobjects.com/posts/your-domain-as-your-bluesky-handle-no-dns-needed","source_url":"","markdown_content":"This blog has a Bluesky account now, and its handle is the domain: [@deallocatedobjects.com](https://bsky.app/profile/deallocatedobjects.com). The usual instructions tell you to add a DNS TXT record. I didn't add one. Bluesky has a second way to prove you own a domain, and it's one file on your web server, which for a static site like this one is the easier place to make a change.\n\n### The Steps\n\nI made the account with a temporary handle, `deallocatedobjects.bsky.social`. Then in Bluesky's Settings, under Account and Handle, I picked \"I have my own domain\" and typed `deallocatedobjects.com`. That screen has two tabs, DNS Panel and No DNS Panel. No DNS Panel says to upload a text file to `https://deallocatedobjects.com/.well-known/atproto-did` containing the account's DID, which it shows you with a copy button.\n\nThe site is a static build, so I put the DID in `content/atproto-did.txt` and had the build write it out:\n\n```ts title=\"src/build.ts\"\nif (existsSync(join(repo, \"content/atproto-did.txt\"))) {\n  const did = (await Bun.file(join(repo, \"content/atproto-did.txt\")).text()).trim();\n  if (/^did:[a-z]+:[A-Za-z0-9._:-]+$/.test(did)) await write(\".well-known/atproto-did\", did);\n}\n```\n\nThe file has no extension, so nginx would guess its type. One line pins it:\n\n```nginx\nlocation = /.well-known/atproto-did { types { } default_type text/plain; }\n```\n\nAfter a deploy I pressed Verify Text File, then Update to deallocatedobjects.com. That button calls `com.atproto.identity.updateHandle` on the account's server, which checks the handle and updates the account's DID document.\n\n### Checking It With Curl\n\nEverything here is public, so you can check each piece without logging in. The file first:\n\n```bash\n$ curl -i https://deallocatedobjects.com/.well-known/atproto-did\nHTTP/2 200\ncontent-type: text/plain; charset=utf-8\ncontent-length: 32\n\ndid:plc:zkms7f37vt7cen6jakhxjrfk\n```\n\n32 bytes, exactly the DID. The text file in the repo ends with a newline and the `.trim()` in the build drops it.\n\nThen ask Bluesky's public API what the handle points to:\n\n```bash\n$ curl 'https://public.api.bsky.app/xrpc/com.atproto.identity.resolveHandle?handle=deallocatedobjects.com'\n{\"did\":\"did:plc:zkms7f37vt7cen6jakhxjrfk\"}\n```\n\nThat's one direction. The other is the DID document, which lives at the PLC directory and has to name the handle back:\n\n```bash\n$ curl https://plc.directory/did:plc:zkms7f37vt7cen6jakhxjrfk\n{ ..., \"alsoKnownAs\": [\"at://deallocatedobjects.com\"], ... }\n```\n\nThe spec requires both. A handle only counts when it resolves to the DID and the DID document claims the handle, otherwise anyone could point their domain at someone else's account. The directory's audit log (`/log/audit` on the same URL) shows the two versions: the first, from account creation, has `at://deallocatedobjects.bsky.social`, and the second, 32 minutes later, has `at://deallocatedobjects.com`.\n\nLast, the profile itself:\n\n```bash\n$ curl 'https://public.api.bsky.app/xrpc/app.bsky.actor.getProfile?actor=deallocatedobjects.com'\n{\"did\":\"did:plc:zkms7f37vt7cen6jakhxjrfk\",\"handle\":\"deallocatedobjects.com\",\"displayName\":\"Deallocated Objects\", ...}\n```\n\n### DNS Or The File\n\nThe [handle spec](https://atproto.com/specs/handle) calls the DNS TXT record \"the recommended and preferred resolution method for individual handle configuration\". It's a record on `_atproto.yourdomain.com` with the value `did=` followed by the DID. The spec says the HTTPS method is meant for large services that can't create thousands of DNS records, and it also covers handles so long that the `_atproto.` prefix would push the name past DNS's 253 character limit.\n\nI'd use DNS when you can get to it easily. It keeps working if you change web hosts, and it doesn't depend on your web server staying up. The file makes sense when the web server is the easy part, like here, or when one server needs to answer for many handles.\n\nIf you have both and they disagree, resolvers are told to prefer the DNS answer. So a stale TXT record can quietly beat your new file.\n\n### Gotchas\n\nThe body should be the DID and nothing else. The spec says servers shouldn't add whitespace around it, though clients should strip a little. Bluesky's app shows a \"Wrong DID returned from server\" error when the file holds a different account's DID.\n\nIt has to be HTTPS on port 443 at the exact handle host. For a handle like `blog.example.com`, the file goes on `blog.example.com`, and a copy on `www.` or over plain `http://` doesn't count. Redirects are allowed \"up to a reasonable number of redirect hops\", so a host that forwards somewhere else still works, but I keep the file answering with a 200 right at the apex.\n\nThe spec says the content type \"does not need to be strictly verified\", but serving `text/plain` costs nothing.\n\nWatch for a build that drops the file. Mine only writes it when the DID matches that regex, so a typo in the text file would ship a site with no `atproto-did` and no error.\n\nIf the file goes away, the handle stops resolving. The spec says the account's handle should then be marked invalid, shown as `handle.invalid`, and the account's server may stop accepting new posts until it verifies again. Other services should keep showing the posts. The DID never changes, so fixing the file brings it all back.\n\nThe old `bsky.social` handle doesn't come along. The app says it stays reserved for you and you can switch back to it, but right now `resolveHandle` on `deallocatedobjects.bsky.social` returns \"Unable to resolve handle\".","html_content":"<p>This blog has a Bluesky account now, and its handle is the domain: <a href=\"https://bsky.app/profile/deallocatedobjects.com\">@deallocatedobjects.com</a>. The usual instructions tell you to add a DNS TXT record. I didn’t add one. Bluesky has a second way to prove you own a domain, and it’s one file on your web server, which for a static site like this one is the easier place to make a change.</p>\n<h2 id=\"the-steps\" data-level=\"3\">The Steps</h2>\n<p>I made the account with a temporary handle, <code>deallocatedobjects.bsky.social</code>. Then in Bluesky’s Settings, under Account and Handle, I picked “I have my own domain” and typed <code>deallocatedobjects.com</code>. That screen has two tabs, DNS Panel and No DNS Panel. No DNS Panel says to upload a text file to <code>https://deallocatedobjects.com/.well-known/atproto-did</code> containing the account’s DID, which it shows you with a copy button.</p>\n<p>The site is a static build, so I put the DID in <code>content/atproto-did.txt</code> and had the build write it out:</p>\n<figure class=\"code\" data-lang=\"typescript\"><figcaption><span class=\"file\">src/build.ts</span><span class=\"lang\">TypeScript</span></figcaption><pre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\"><code><span class=\"line\"><span style=\"--shiki-light:#D73A49;--shiki-dark:#F97583\">if</span><span style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> (</span><span style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">existsSync</span><span style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">(</span><span style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">join</span><span style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">(repo, </span><span style=\"--shiki-light:#032F62;--shiki-dark:#9ECBFF\">\"content/atproto-did.txt\"</span><span style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">))) {</span></span>\n<span class=\"line\"><span style=\"--shiki-light:#D73A49;--shiki-dark:#F97583\">  const</span><span style=\"--shiki-light:#005CC5;--shiki-dark:#79B8FF\"> did</span><span style=\"--shiki-light:#D73A49;--shiki-dark:#F97583\"> =</span><span style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> (</span><span style=\"--shiki-light:#D73A49;--shiki-dark:#F97583\">await</span><span style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> Bun.</span><span style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">file</span><span style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">(</span><span style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">join</span><span style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">(repo, </span><span style=\"--shiki-light:#032F62;--shiki-dark:#9ECBFF\">\"content/atproto-did.txt\"</span><span style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">)).</span><span style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">text</span><span style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">()).</span><span style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">trim</span><span style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">();</span></span>\n<span class=\"line\"><span style=\"--shiki-light:#D73A49;--shiki-dark:#F97583\">  if</span><span style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> (</span><span style=\"--shiki-light:#032F62;--shiki-dark:#9ECBFF\">/</span><span style=\"--shiki-light:#D73A49;--shiki-dark:#F97583\">^</span><span style=\"--shiki-light:#032F62;--shiki-dark:#DBEDFF\">did:</span><span style=\"--shiki-light:#005CC5;--shiki-dark:#79B8FF\">[a-z]</span><span style=\"--shiki-light:#D73A49;--shiki-dark:#F97583\">+</span><span style=\"--shiki-light:#032F62;--shiki-dark:#DBEDFF\">:</span><span style=\"--shiki-light:#005CC5;--shiki-dark:#79B8FF\">[A-Za-z0-9._:-]</span><span style=\"--shiki-light:#D73A49;--shiki-dark:#F97583\">+$</span><span style=\"--shiki-light:#032F62;--shiki-dark:#9ECBFF\">/</span><span style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">.</span><span style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">test</span><span style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">(did)) </span><span style=\"--shiki-light:#D73A49;--shiki-dark:#F97583\">await</span><span style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\"> write</span><span style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">(</span><span style=\"--shiki-light:#032F62;--shiki-dark:#9ECBFF\">\".well-known/atproto-did\"</span><span style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">, did);</span></span>\n<span class=\"line\"><span style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">}</span></span></code></pre></figure><p>The file has no extension, so nginx would guess its type. One line pins it:</p>\n<figure class=\"code\" data-lang=\"nginx\"><figcaption><span class=\"lang\">nginx</span></figcaption><pre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\"><code><span class=\"line\"><span style=\"--shiki-light:#D73A49;--shiki-dark:#F97583\">location</span><span style=\"--shiki-light:#D73A49;--shiki-dark:#F97583\"> =</span><span style=\"--shiki-light:#032F62;--shiki-dark:#DBEDFF\"> /.well-known/atproto-did </span><span style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">{ </span><span style=\"--shiki-light:#D73A49;--shiki-dark:#F97583\">types</span><span style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> { }</span><span style=\"--shiki-light:#D73A49;--shiki-dark:#F97583\"> default_type </span><span style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">text/plain; }</span></span></code></pre></figure><p>After a deploy I pressed Verify Text File, then Update to deallocatedobjects.com. That button calls <code>com.atproto.identity.updateHandle</code> on the account’s server, which checks the handle and updates the account’s DID document.</p>\n<h2 id=\"checking-it-with-curl\" data-level=\"3\">Checking It With Curl</h2>\n<p>Everything here is public, so you can check each piece without logging in. The file first:</p>\n<figure class=\"code\" data-lang=\"bash\"><figcaption><span class=\"lang\">Shell</span></figcaption><pre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\"><code><span class=\"line\"><span style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">$</span><span style=\"--shiki-light:#032F62;--shiki-dark:#9ECBFF\"> curl</span><span style=\"--shiki-light:#005CC5;--shiki-dark:#79B8FF\"> -i</span><span style=\"--shiki-light:#032F62;--shiki-dark:#9ECBFF\"> https://deallocatedobjects.com/.well-known/atproto-did</span></span>\n<span class=\"line\"><span style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">HTTP/2</span><span style=\"--shiki-light:#005CC5;--shiki-dark:#79B8FF\"> 200</span></span>\n<span class=\"line\"><span style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">content-type:</span><span style=\"--shiki-light:#032F62;--shiki-dark:#9ECBFF\"> text/plain</span><span style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">; charset</span><span style=\"--shiki-light:#D73A49;--shiki-dark:#F97583\">=</span><span style=\"--shiki-light:#032F62;--shiki-dark:#9ECBFF\">utf-8</span></span>\n<span class=\"line\"><span style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">content-length:</span><span style=\"--shiki-light:#005CC5;--shiki-dark:#79B8FF\"> 32</span></span>\n<span class=\"line\"></span>\n<span class=\"line\"><span style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">did:plc:zkms7f37vt7cen6jakhxjrfk</span></span></code></pre></figure><p>32 bytes, exactly the DID. The text file in the repo ends with a newline and the <code>.trim()</code> in the build drops it.</p>\n<p>Then ask Bluesky’s public API what the handle points to:</p>\n<figure class=\"code\" data-lang=\"bash\"><figcaption><span class=\"lang\">Shell</span></figcaption><pre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\"><code><span class=\"line\"><span style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">$</span><span style=\"--shiki-light:#032F62;--shiki-dark:#9ECBFF\"> curl</span><span style=\"--shiki-light:#032F62;--shiki-dark:#9ECBFF\"> 'https://public.api.bsky.app/xrpc/com.atproto.identity.resolveHandle?handle=deallocatedobjects.com'</span></span>\n<span class=\"line\"><span style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">{</span><span style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">\"did\"</span><span style=\"--shiki-light:#005CC5;--shiki-dark:#79B8FF\">:</span><span style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">\"did:plc:zkms7f37vt7cen6jakhxjrfk\"</span><span style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">}</span></span></code></pre></figure><p>That’s one direction. The other is the DID document, which lives at the PLC directory and has to name the handle back:</p>\n<figure class=\"code\" data-lang=\"bash\"><figcaption><span class=\"lang\">Shell</span></figcaption><pre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\"><code><span class=\"line\"><span style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">$</span><span style=\"--shiki-light:#032F62;--shiki-dark:#9ECBFF\"> curl</span><span style=\"--shiki-light:#032F62;--shiki-dark:#9ECBFF\"> https://plc.directory/did:plc:zkms7f37vt7cen6jakhxjrfk</span></span>\n<span class=\"line\"><span style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">{ </span><span style=\"--shiki-light:#005CC5;--shiki-dark:#79B8FF\">...</span><span style=\"--shiki-light:#032F62;--shiki-dark:#9ECBFF\">,</span><span style=\"--shiki-light:#032F62;--shiki-dark:#9ECBFF\"> \"alsoKnownAs\":</span><span style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\"> [</span><span style=\"--shiki-light:#032F62;--shiki-dark:#9ECBFF\">\"at://deallocatedobjects.com\"</span><span style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">], ... }</span></span></code></pre></figure><p>The spec requires both. A handle only counts when it resolves to the DID and the DID document claims the handle, otherwise anyone could point their domain at someone else’s account. The directory’s audit log (<code>/log/audit</code> on the same URL) shows the two versions: the first, from account creation, has <code>at://deallocatedobjects.bsky.social</code>, and the second, 32 minutes later, has <code>at://deallocatedobjects.com</code>.</p>\n<p>Last, the profile itself:</p>\n<figure class=\"code\" data-lang=\"bash\"><figcaption><span class=\"lang\">Shell</span></figcaption><pre class=\"shiki shiki-themes github-light github-dark\" style=\"--shiki-light:#24292e;--shiki-dark:#e1e4e8;--shiki-light-bg:#fff;--shiki-dark-bg:#24292e\" tabindex=\"0\"><code><span class=\"line\"><span style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">$</span><span style=\"--shiki-light:#032F62;--shiki-dark:#9ECBFF\"> curl</span><span style=\"--shiki-light:#032F62;--shiki-dark:#9ECBFF\"> 'https://public.api.bsky.app/xrpc/app.bsky.actor.getProfile?actor=deallocatedobjects.com'</span></span>\n<span class=\"line\"><span style=\"--shiki-light:#24292E;--shiki-dark:#E1E4E8\">{</span><span style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">\"did\"</span><span style=\"--shiki-light:#005CC5;--shiki-dark:#79B8FF\">:</span><span style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">\"did:plc:zkms7f37vt7cen6jakhxjrfk\"</span><span style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">,</span><span style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">\"handle\"</span><span style=\"--shiki-light:#005CC5;--shiki-dark:#79B8FF\">:</span><span style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">\"deallocatedobjects.com\"</span><span style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">,</span><span style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">\"displayName\"</span><span style=\"--shiki-light:#005CC5;--shiki-dark:#79B8FF\">:</span><span style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">\"Deallocated Objects\"</span><span style=\"--shiki-light:#6F42C1;--shiki-dark:#B392F0\">,</span><span style=\"--shiki-light:#032F62;--shiki-dark:#9ECBFF\"> ...}</span></span></code></pre></figure><h2 id=\"dns-or-the-file\" data-level=\"3\">DNS Or The File</h2>\n<p>The <a href=\"https://atproto.com/specs/handle\">handle spec</a> calls the DNS TXT record “the recommended and preferred resolution method for individual handle configuration”. It’s a record on <code>_atproto.yourdomain.com</code> with the value <code>did=</code> followed by the DID. The spec says the HTTPS method is meant for large services that can’t create thousands of DNS records, and it also covers handles so long that the <code>_atproto.</code> prefix would push the name past DNS’s 253 character limit.</p>\n<p>I’d use DNS when you can get to it easily. It keeps working if you change web hosts, and it doesn’t depend on your web server staying up. The file makes sense when the web server is the easy part, like here, or when one server needs to answer for many handles.</p>\n<p>If you have both and they disagree, resolvers are told to prefer the DNS answer. So a stale TXT record can quietly beat your new file.</p>\n<h2 id=\"gotchas\" data-level=\"3\">Gotchas</h2>\n<p>The body should be the DID and nothing else. The spec says servers shouldn’t add whitespace around it, though clients should strip a little. Bluesky’s app shows a “Wrong DID returned from server” error when the file holds a different account’s DID.</p>\n<p>It has to be HTTPS on port 443 at the exact handle host. For a handle like <code>blog.example.com</code>, the file goes on <code>blog.example.com</code>, and a copy on <code>www.</code> or over plain <code>http://</code> doesn’t count. Redirects are allowed “up to a reasonable number of redirect hops”, so a host that forwards somewhere else still works, but I keep the file answering with a 200 right at the apex.</p>\n<p>The spec says the content type “does not need to be strictly verified”, but serving <code>text/plain</code> costs nothing.</p>\n<p>Watch for a build that drops the file. Mine only writes it when the DID matches that regex, so a typo in the text file would ship a site with no <code>atproto-did</code> and no error.</p>\n<p>If the file goes away, the handle stops resolving. The spec says the account’s handle should then be marked invalid, shown as <code>handle.invalid</code>, and the account’s server may stop accepting new posts until it verifies again. Other services should keep showing the posts. The DID never changes, so fixing the file brings it all back.</p>\n<p>The old <code>bsky.social</code> handle doesn’t come along. The app says it stays reserved for you and you can switch back to it, but right now <code>resolveHandle</code> on <code>deallocatedobjects.bsky.social</code> returns “Unable to resolve handle”.</p>","created_at":"2026-11-19T14:00:00.000Z","updated_at":"2026-11-19T14:00:00.000Z"}