Skip to content

How Custom Domains Work

A custom domain is an additional hostname that routes traffic to your application’s upstream. It allows the same application to be accessed through multiple domain names.

For example:

customer.com → app.example.com (upstream)

Both domain names refer to the same application, but Hostgrid forwards requests from the custom domain to the configured upstream.

Once configured, Hostgrid handles DNS verification, SSL provisioning, and request routing automatically.


When a request is made to a custom domain, Hostgrid only processes it if the domain has already been verified and activated.

Unverified domains do not serve any traffic.

Once a domain is active, Hostgrid processes incoming requests in the following order:

  1. The request is received on the custom domain
  2. Upstream rules are executed
  3. Domain rules are executed
  4. The request is forwarded to the upstream
  5. The upstream response is returned to the user

Hostgrid automatically provisions and renews SSL certificates for all active domains. HTTPS is enforced for all traffic without requiring manual certificate management.

This allows you to use custom domains with your application without modifying your infrastructure.


Relationship between domains and upstreams

Section titled “Relationship between domains and upstreams”

Each custom domain is linked to exactly one upstream.

However, a single upstream can serve multiple custom domains.

Example:

Upstream
app.example.com
┌───────────────┼───────────────┐
│ │ │
▼ ▼ ▼
customer-a.com customer-b.com portal.customer-c.com

This model is useful for:

  • Multi-tenant SaaS applications
  • White-labeled customer portals
  • Multiple brands sharing the same backend

To understand upstreams, see the Understanding Upstreams guide.


To create a custom domain, first select an upstream in your dashboard.

Then click Add Domain.

Add Domain Button

The domain configuration modal will open.

Create Domain Modal


The Host is the domain name that users will use to access your application.

Examples:

example.com
app.example.com
portal.customer.com

This value determines the public URL that routes traffic to your upstream.


If provided, Hostgrid will automatically a step-by-step DNS setup guide to that address.

This reduces setup friction for non-technical users and improves onboarding success.

If you filled in the Instructions Email Recipient, you should receive an email there looking like this:

Automated DNS Instructions Emails


Prepend Path allows you to forward requests to your upstream with an added path prefix.

For example:

customer.com → app.example.com/dashboard

This is useful when your application expects traffic under a specific route prefix.


After creating a domain, Hostgrid will show a DNS status indicator.

If DNS records are missing or incorrect, the status will show Not Found.

Click the status badge to view setup instructions.

DNS Not Found

The DNS instructions pop-up will appear:

DNS Instructions Popup

Once DNS records are correctly configured and propagated, the status will update automatically.

DNS Verified


Once a domain is verified:

  • SSL certificate is automatically issued
  • HTTPS is enabled
  • Traffic begins routing to the upstream
  • The domain becomes active

No manual certificate setup is required.

See: Automatic SSL Guide


Once your domain is active:

  • Requests to the domain are routed to your upstream
  • Upstream rules are applied first
  • Domain rules are applied second
  • Responses are returned to the user through Hostgrid

To configure routing behavior, see: Hostgrid Rules