Most of this tutorial would work for a custom domain name, however the caddy container that you build, would require a different plugin/module and configuration in the Caddyfile. A list of DNS plugins are shown here.
So for example if you use IONOS for your custom domain name you would use this plugin/module and adapt your Caddyfile using the example provided.
Hope this helps.