Brewless Brewless Docs

Running your application

Domains

How to make an environment answer on a domain of your own, with a certificate.

On this page

Without a domain of your own, an environment is reached on the address its provider gave it. An own domain comes with a plan, on any environment: production, staging or development. Without a subscription it is refused, and the Domains block of the environment says so instead of offering the form; see Billing. To make an environment answer on your own domain:

brewless domain:add production shop.example.eu
brewless domain:add staging staging.shop.example.eu

You can do the same under Domains on the page of the environment in the console, or name the domains in your brewless.yml:

brewless.yml
environments:
  production:
    domains:
      - shop.example.eu
      - www.shop.example.eu

brewless deploy names each domain the environment does not answer on yet and asks before it adds them, under the same rules. Adding a domain can move its visitors: when its DNS zone is in your bunny.net or Scaleway account, the record is pointed at Brewless. Without a terminal, or with --no-interaction, nothing is added unless you pass --domains. A domain the file does not name is not removed, and Brewless has no way yet to take a domain off an environment.

DNS

Where the record comes from depends on what stands in front of the environment.

With bunny.net connected. When the DNS of the domain is at Bunny DNS in your account, or at Scaleway DNS in your Scaleway project, the record is made for you, before the name goes on the pull zone, and Brewless takes over the zone for this environment if it did not manage it yet: it says so, and changes nothing else in the zone. At Bunny DNS the record leads straight to the pull zone. At Scaleway DNS it is a CNAME to the pull zone's address, and on the domain itself, where a CNAME may not stand, an ALIAS. A wildcard needs its zone at Bunny DNS: bunny.net only proves a wildcard through its own DNS. Its records are then on the DNS records page. bunny.net checks a wildcard's record before it takes the name; while it does not see the fresh record yet, Brewless tries again. When bunny.net refuses a name for another reason, the error gives bunny.net's own words. Is the DNS kept elsewhere? See below.

Without bunny.net. The name goes straight on the Scaleway container. Brewless makes no record: make it at your DNS provider, as below.

DNS at a provider of your own

You do not have to move your nameservers. When the zone of a domain is not at Bunny DNS or Scaleway DNS in your accounts, Brewless shows the record the name needs and you make it at your own DNS provider. Brewless never changes that record; it only looks it up in the public DNS, and never asks your application anything, so no container wakes up for it.

  • Adding the domain does not wait. brewless domain:add and the console say which record to make, such as CNAME shop.example.eu → acme-shop-production.b-cdn.net. The domain is then Waiting for DNS.
  • Brewless looks it up by itself. Every 5 minutes for the first hour, then every hour. Once the record points the right way, Brewless asks for the certificate. With bunny.net in front the name is on the pull zone from the start. Without it, Brewless attaches the name to the container only once the record points there, because Scaleway remembers a miss for up to an hour.
  • A reminder after a day. The owners of the organisation, and whoever added the domain, get a mail with the record when it is still not there after 24 hours, and another when the domain is live.
  • After 36 hours Brewless stops looking. The domain is then Stopped waiting, and a mail says so. Make the record, then press Check DNS now at the domain, or run brewless domain:check, and Brewless looks for it again for two hours.
  • Check DNS now. At every domain whose DNS you keep yourself, live or not, and whatever the 36 hours did: it looks the record up at once, and then every 15 minutes for two hours, eight more looks, until the record is found; whichever comes first. In the first hour of a wait the 5-minute looks go on as well. One press a minute per domain. Addresses Brewless cannot match to the edge, such as an ALIAS on the domain itself, are not found yet: the looks go on, and the certificate that would prove an ALIAS is asked for at most once an hour. It says what it found: DNS found means the record points the right way and the domain is being connected (or is live already); not found yet says until when Brewless keeps looking. A domain Brewless had stopped waiting for goes back to Stopped waiting when the two hours bring nothing, without another mail. A live domain whose record is gone is DNS changed, and is looked at every 15 minutes for those two hours too, until it points here again.

Some DNS providers add your domain to the name by themselves. Then enter only the part before it: shop for shop.example.eu.

The domain itself

A CNAME may not stand on the domain of a zone itself, such as example.eu. For such a name Brewless asks for an ALIAS, and the console names the ways to get there:

  • Your DNS provider offers ALIAS, ANAME or CNAME flattening. Make that record, pointing to the target. An ALIAS answers with addresses, and they need not be the ones Brewless gets for the target, so a lookup cannot always see that it points the right way. Then Brewless asks bunny.net for the certificate, which proves it. It does so at most once an hour, because Let's Encrypt allows only a few failed tries per name an hour.
  • Your registrar forwards example.eu to www.example.eu. Add www.example.eu instead, with a CNAME.
  • Move this one zone to Bunny DNS in your bunny.net account. Brewless then makes the record itself; see Moving your domain to Brewless.

After it is live

Brewless looks the record of a live domain up once a day. When it no longer points at the environment, the domain shows DNS changed and the owners get a mail. Put the record back; the next look notices it. When the environment answers on a new address, such as a web container made anew without bunny.net in front, the record has to follow: the console shows the new record, a mail says which, and nothing at your DNS provider is changed. Every change is in the audit trail (domain.awaiting_dns, domain.live, domain.failed, domain.dns_changed, domain.target_changed).

All records you keep yourself, for every environment, are listed together on the DNS page; see DNS records.

Note

Adding a domain never changes a record that already leads somewhere else: it only creates records that do not exist yet. When one is in the way, the error names it, by id, type and value, with the brewless dns:remove command that removes it. To change such a record yourself, use DNS records.

A name that points at a private address, such as 10.0.0.5 or ::1, is refused: a domain of an environment is a name on the public internet. A name that has no address yet is fine; the DNS can come later.

The test address

Next to the addresses its providers gave it, every environment gets a test address from Brewless, with each deploy: <organisation>-<application>-<environment> under Brewless's test domain, such as acme-shop-production.brewless.dev. It is a CNAME in Brewless's own zone that leads straight to the web container, so it works whether or not you have a domain of your own, and with or without bunny.net in front. Brewless attaches the name to the container with your Scaleway key, as it does any domain, and Scaleway issues its certificate once the record is live; that can take a few minutes after the first deploy. Scaleway looks the name up the moment it is attached and remembers a miss for up to an hour, so Brewless waits two minutes after it makes the record before it attaches the name. A name Scaleway gave up on anyway is taken off and attached anew two minutes later. The console lists it as Test address.

With brewless/laravel 0.5.1 or later, your application answers the test address as if it were asked for the host of APP_URL, so an application that only answers on its own domain works there too, while the links and files on its pages stay on the test address. Every page on the test address tells search engines to stay away (X-Robots-Tag: noindex, nofollow), and its robots.txt disallows everything, unless your application has a public/robots.txt of its own: the web server hands out that file as it is.

The test domain only lets Let's Encrypt issue certificates for its names (a CAA record), which is the authority Scaleway uses. The certificate and its TLS settings are Scaleway's: a test address leads straight to the container, without bunny.net in front, so a check such as internet.nl reports what Scaleway offers there. A security.txt comes from your application: with brewless/laravel 1.9 or later, set BREWLESS_SECURITY_CONTACT among your variables and it answers /.well-known/security.txt on every address, the test address included.

Visitors of the test address go straight to your container, never through Brewless. When two environments would get the same name, the second one gets a short code at the end, and so does a name longer than DNS allows. A name under the test domain cannot be added as a domain of your own. When you delete an environment or let Brewless go of it, its record is taken out of the zone; the name on your container stays until you remove it. An environment without a domain of its own has its files address under the test domain too, cdn- and the label of its test address. Its record goes when you delete the environment, and stays when you let Brewless go of it, so the links to your public files keep working.

Without the organisation in the name

By default the organisation is in every name of an environment, which you also see in the record for your own domain: acme-shop-production.brewless.dev, and acme-shop-production.b-cdn.net for the pull zone. test_address in brewless.yml changes what goes in front of <application>-<environment>:

test_address Test address Pull zone at bunny.net
organisation (default) acme-shop-production.brewless.dev acme-shop-production.b-cdn.net
short shop-production.brewless.dev shop-production.b-cdn.net
random k3x9q2ab-shop-production.brewless.dev k3x9q2ab-shop-production.b-cdn.net
brewless.yml
environments:
  production:
    test_address: short

random uses a value of eight letters and digits that Brewless gave the environment when it was made, so the name stays the same with every deploy. Every name under the test domain belongs to one environment: when short gives a name another environment has already, yours gets a short code at the end, as above. With short names go to whoever asks first, so a common name such as website-production may already be taken; random does not have that problem.

The next deploy applies it. The environment gets its new test address and its files address under the test domain, and the old names, their records and their attachment to the container are taken away. A pull zone at bunny.net cannot be renamed, so the environment gets new pull zones with the new name: the hostnames of the old pull zone move to the new one, and the old pull zone and the pull zone for files are deleted; the deploy makes the pull zone for files again under the new name. Without test_address nothing changes, and a pull zone with a name Brewless did not give it in one of these styles, such as one from before the application got another name, keeps its name too. The replacement also only happens while nothing leads to the old pull zone yet: none of your domains is Active, and no files address of your own has its certificate. Otherwise the pull zones keep their name, the deploy says so, and only the test address changes. The record a domain that is still Waiting for DNS needs then follows the new name within a few minutes, in the console and in brewless domain:list.

While an organisation is blocked, for example after a report of phishing on brewless.eu/abuse, the records of all its test addresses and files addresses under the test domain are taken out of the zone, and a deploy that was still underway makes none. The names stay on the containers and nothing else changes in your accounts: your own domains keep working. Unblocking makes the records again, and two minutes later Brewless checks the names on the containers, as after a first deploy.

Your application's own address

When the domain is added and your application still calls the provider's address its own (APP_URL for Laravel), Brewless says so, and brewless domain:add offers to set it to the new domain. It is only changed after a yes, and takes effect with the next deploy. Moving your domain to Brewless walks through the whole move.

Redirect domains

An old domain, or a second one you only keep so its visitors find you, does not have to reach your application. Name it under redirect_domains and bunny.net answers every request for it with a 301 itself, for every path and query string, so no container wakes up for it:

brewless.yml
environments:
  production:
    domains:
      - coding.agency
    redirect_domains:
      jaspur.nl: https://coding.agency/
      www.jaspur.nl: https://coding.agency/
      old-shop.example.eu:
        to: https://shop.example.eu
        keep_path: true
  • Where it goes. With an address alone, every page of the domain goes to that one address. With keep_path: true the path asked for goes after it, so old-shop.example.eu/shoes/red goes to https://shop.example.eu/shoes/red; the query string is not taken along, and the address under to then has no path of its own. The address starts with https://, has no query string and is not on the redirect domain itself.
  • Added like any domain. The name goes on the pull zone with its certificate, through the same steps, DNS check and record as a domain under domains, ALIAS for the domain itself included (see The domain itself). When your DNS provider offers no ALIAS, ANAME or CNAME flattening and the zone is not at Bunny DNS or Scaleway DNS, the domain itself cannot point at bunny.net; its www can. brewless deploy asks before it adds them, as it does for domains.
  • Only the address records. Brewless only makes the record that points the name at the pull zone. MX, TXT and every other record of the domain stay as they are, so mail on the old domain keeps working.
  • Certificates keep working. /.well-known/acme-challenge/ is never sent on, so bunny.net can issue and renew the certificate of the name.
  • Never the application's address. A redirect domain is never offered as your application's own address, never warmed after a release, never kept with edge.keep_pages and never published to with edge.publish. Its 301s are counted as answered by the edge, not by your container.
  • Taking one away. A deploy whose file no longer names a redirect domain takes its rule and its name off the pull zone, which is in the audit trail as domain.redirect_removed. Only names Brewless added as redirect domains are taken off: one you move to domains stays, and a domain under domains is never removed this way. A name cannot be under both.

It needs bunny.net in front of the environment: without a pull zone the deploy refuses the file and says so. Each address is one edge rule on the pull zone, shared by at most two domains, such as jaspur.nl and www.jaspur.nl: an environment has at most four redirect domains, going to at most two different addresses.

Certificates

The provider issues the certificate once the DNS record is live, and renews it by itself, also when Brewless is not around.

Brewless reads when each certificate runs out and tells you when a renewal did not happen in time.

Key type

At bunny.net, a certificate is issued with an ECDSA key or an RSA key. Brewless asks for ECDSA for every domain it adds, before the first certificate is issued; a certificate that is already there is not touched. The Domains block shows each domain's key type.

A domain on RSA, for instance one added before Brewless asked for ECDSA, can be switched with Use an ECDSA key. bunny.net uses the new key type for the next certificate it issues for the name: the certificate in use stays until then, so the domain is never without one. The switch can be undone on the same page, and every switch is in the audit trail. It takes the right to manage the applications.

bunny.net states that it issues the replacement of a certificate with a P-256 key with an ECDSA P-384 key. A certificate bunny.net issued on 4 December 2026 still had a P-256 key, so Brewless does not offer to ask for a new certificate early: it would not give a stronger key. For a P-384 key, Brewless can issue the certificates of an environment itself; see Certificates with a P-384 key.

Neither key type is safe against a quantum computer; ECDSA is smaller and stronger at the same size. What a quantum computer could do to a connection is about its key exchange, see Post-Quantum Readiness.