Have you ever wanted to host a site

but didn’t want it on a personally identifiable IP

and already been a Fastmail customer using their web file hosting

but needed a refresher on how best to sync your changes programmatically when you rebuild your site

and how to set up DNS for the new domain without fucking up and wasting 30 minutes for them to pull your fixed records
because you want to have an apex domain be the canonical URL but the docs say to CNAME to their servers and you can’t CNAME an apex domain and besides enabling HTTPS gives all sorts of errors that way

Fastmail websites live in the “Files” section of the Fastmail web UI. You create a website on a domain and point it at a folder and it hosts the static contents of that folder on that domain. Easy right?

Fastmail files also supports WebDAV, so the answer to syncing changes to your site is rclone. run this once to configure a remote into your files:

rclone config create fastmail webdav \
    url https://myfiles.fastmail.com \
    vendor other \
    user 'whoever@fastmail.com' \
    password 'yourAppPassword'

then to sync your local changes into Fastmail:

rclone sync /path/to/your/site fastmail:path/to/your/website/folder

(this process should be similar for any other static hosting provider that lets you interface with the site’s contents via WebDAV. it’s kind of neat!)

as far as DNS goes, the DNS help center article says you should just CNAME your domain to web.fastmail.com or web.messagingengine.com, but if you want an apex domain you can’t CNAME anything. instead you want to look a little deeper and check what DNS records Fastmail would be serving for your domain if you were using them as your hosting provider. you can check this in settings > domains > edit a domain > customize DNS. you’ll see that they don’t CNAME shit, they just have A records pointing at their hosting servers 103.168.172.37 and 103.168.172.52. so you can create your own A records on your apex domain pointing at those servers and it’ll Just Work.

if you also want to redirect the www subdomain back to your apex domain, (and you should, because people will type it anyway,) you’ll want to CNAME that subdomain to your apex domain so Fastmail will be serving both domains, and then set up a second website in Fastmail for the www subdomain and just set it to redirect to your canonical URL.

and just as a note: setting a low TTL on your DNS records will not save you from having to wait a long time for Fastmail to re-fetch your records if you fuck up the first time and have to change them. even with a TTL of 30s, i still waited at least half an hour before the new records took effect, and the “re-check DNS” button in domain settings doesn’t seem to refresh its view of non-mail records so there’s literally nothing you can do about it.

god i love computers.