Custom domains with sourcehut pages

In order to use a custom domain, you must first configure your website’s DNS records accordingly. You can do this at your domain registrar’s dashboard.

Top-level domains

To add a domain like example.org, you need to add an A record which points to 46.23.81.157 and an AAAA record which points to 2a03:6000:1813:1337::157.

@ IN A    46.23.81.157
@ IN AAAA 2a03:6000:1813:1337::157
We reserve the right to change this IP address. If your site will be affected, we'll send you an email at least 30 days in advance. Make sure your email address is up to date!

Once you’ve updated your domain’s DNS zone, you can publish to it. The instructions from the quickstart guide apply, but substitute the domain name you want to publish under in the “hut” commands, like so:

$ hut pages publish -d example.org site.tar.gz

You can publish any number of websites to any number of domains on SourceHut pages. If you already published on your “username.srht.site” domain, you must publish again to any additional domains you want to use.

Back to the quick start

Second-level domains

Simply add a CNAME record which points to pages.sr.ht. (the period at the end is important!). For example, to add foobar.example.org (in bind format):

foobar IN CNAME pages.sr.ht.

NOTE: Some (bad) domain registrars will complain about the trailing period. If this happens, just remove it, and it’ll probably work. If it doesn’t work, please send an angry email to your crappy domain registrar.

Once you’ve updated your domain’s DNS zone, you can publish to it. The instructions from the quickstart guide apply, but substitute the domain name you want to publish under in the “hut” commands, like so:

$ hut pages publish -d example.org site.tar.gz

You can publish any number of websites to any number of domains on SourceHut pages. If you already published on your “username.srht.site” domain, you must publish again to any additional domains you want to use.

Back to the quick start