Custom domains
Serve your services from domains you own, with automatic TLS.
By default, every public service gets a managed *.spcf.app URL. To serve a service from a domain you own, attach a custom domain to it.
Attach a custom domain
Deploy the service first, then run:
specific domain add <service> <domain>
For example:
specific domain add web api.example.com
The command prints the DNS records to configure at your registrar. The DNS change is the one step Specific can’t do for you.
By default the command targets the environment linked in your project directory (set by the most recent specific deploy). To target a different environment, pass --environment:
specific domain add web api.example.com --environment staging
DNS records
The output includes two options; pick one based on what your DNS provider supports:
- CNAME - recommended for subdomains (
api.example.com,app.example.com). Points the subdomain atingress.specific.dev. - A record - recommended for apex domains (
example.com), since most DNS providers don’t allow CNAMEs at the zone apex. Points the domain at one of three Specific ingress IPs (any one works; the output shows one).
TLS certificates are issued automatically via Let’s Encrypt once DNS resolves to Specific’s ingress. There is no separate verification step: configure DNS and wait a few minutes.
Confirming the domain
Adding a domain registers it with Specific, but doesn’t verify that DNS is configured correctly or that TLS has been issued. To verify end-to-end once DNS is configured:
curl https://<domain>
Managing domains in the dashboard
Custom domains can also be added, listed, and removed in the dashboard. The dashboard is currently the only way to remove a custom domain; there is no specific domain remove command.
Common questions
Can I attach several domains to one service?
Yes. Run specific domain add once per domain. A domain can only be attached to one service at a time; adding a domain that is already in use on Specific returns an error.
How do I serve both example.com and www.example.com?
Add them as two domains on the same service: an A record for the apex and a CNAME for www. Redirecting one to the other is up to your application.
Do custom domains work in every environment?
A domain is attached to a service in one environment, so staging and production can each have their own. Custom domains are available on paid plans; see pricing.
How long until the domain works?
Usually a few minutes after the DNS record is in place: Specific issues the certificate as soon as the domain resolves to its ingress. DNS changes themselves can take longer to propagate, depending on the record’s previous TTL.
Do certificates renew automatically?
Yes. Certificates are issued and renewed through Let’s Encrypt without any action on your side, as long as the DNS record keeps pointing at Specific.