thelastapi
Get started free

Connect a domain you already own

Connect a domain you already own to your website using the vibiz CLI, configure the required DNS records, and enable automatic HTTPS.

On this page 9 sections

To connect a domain you already own to your website, run vibiz domains add <domain>, copy the required DNS records from vibiz domains into your current registrar's DNS dashboard, and run vibiz domains verify <domain> to complete activation. HTTPS turns on automatically once the records are in place. If your web app is hosted on an external service while using thelastapi for features like analytics or authentication, pass the --elsewhere flag to configure the domain appropriately.

Every app on thelastapi answers at https://<slug>.vibiz.app for as long as the project exists; hosting is not charged today while its pricing is decided. When your product is ready for production, using a custom domain gives your brand a clean web address. This guide walks you through connecting an existing domain, handling verification, understanding DNS requirements, and managing the domain lifecycle from your terminal.

How connecting an existing domain works

When you bring a domain that you registered at another registrar, the registration and authoritative nameservers remain at that third party. You do not need to transfer the domain to thelastapi to use it with your app.

Here is the difference between connecting an outside domain and purchasing one natively:

  • Connected domains: You keep your existing registrar and manage DNS records in that registrar's dashboard. You run vibiz domains add to register the name with your project, which outputs the target records you need to insert at your provider. Because your registrar hosts the zone file, commands like vibiz domains records do not apply and return 400 invalid_request (dns_elsewhere).
  • Bought domains: When you purchase a domain directly using vibiz domains buy, thelastapi hosts the DNS zone on its nameservers (dns_by_vibiz: true). That lets the platform create routing records, issuance records, and email forwarding rules without manual intervention. For more details on that workflow, see Buy a domain name with an API or one command and the official Domains documentation.

If you already have a domain, connecting it takes only a couple of minutes.

Step 1: Add the domain to your project

From your project directory, add the domain using the CLI:

Terminal
vibiz domains add acmebakery.com

If your web application runs on another hosting service and you are connecting the domain for analytics or sign-in, add the --elsewhere flag:

Terminal
vibiz domains add acmebakery.com --elsewhere

Once added, the project immediately configures several services:

  • Analytics: Traffic tracking begins counting visits from this domain right away, even before the records verify.
  • Sign-in: Google or GitHub authentication trusts the domain as soon as its verification TXT record is validated, or when an account owner confirms it.
  • HTTPS: The platform requests a TLS certificate automatically as soon as the routing records resolve to our hosting.

Step 2: Retrieve the DNS records to configure

To see what records your current registrar needs, inspect the domain status:

Terminal
vibiz domains

For scripts or automated pipelines, request the machine-readable output:

Terminal
vibiz domains --json

This output displays the domain's current state and lists the records you must paste into your registrar's DNS settings. Typically, this includes:

  1. Routing records: A CNAME or A record that points web traffic for your apex domain or subdomain to thelastapi hosting.
  2. Verification record: A TXT record used to prove that you control the domain.

If you are setting up authentication or third-party verification, read Add a DNS TXT record to verify your domain for specific guidelines on TXT values and formatting.

Log in to the account where your domain was registered, open its DNS management panel, and add the records specified by the CLI.

Step 3: Verify the records and issue certificates

DNS changes can take time to spread across networks, though modern providers often update within a few minutes. You can check the verification status at any time:

Terminal
vibiz domains verify acmebakery.com

The verify command inspects the domain's live DNS records and TXT proof. Once detected:

  • The domain status updates from pending to active.
  • HTTPS certificates issue automatically.
  • Sign-in callbacks and analytics finalize their setup.

You can inspect all connected domains on the project by running vibiz domains without arguments to see their active status.

Connected domains vs. natively managed domains

Before continuing, consider whether keeping your domain at an outside registrar or managing it inside the platform fits your operational goals.

FeatureConnected domain (vibiz domains add)Native domain (vibiz domains buy)
RegistrarYour existing registrarthelastapi (billed via credits)
DNS hostingHandled at your registrarHosted automatically
Routing recordsCopied manually to registrarWritten automatically
HTTPS setupAutomatic once records verifyAutomatic upon registration
Record editing via CLINot supported (dns_elsewhere)Supported (vibiz domains records add)
Email forwardingManaged through external MXAutomated via vibiz email forward
Multi-project routingPointed manuallyvibiz domains use / move

If you retain an external registrar, keep in mind that CLI commands designed to manage zone records—such as vibiz domains records add acmebakery.com TXT key value—are only available for natively purchased domains. If you execute record modifications against an external domain, the API returns:

Text
400 invalid_request (dns_elsewhere)

For connected domains, all record adjustments (including A, AAAA, CNAME, and MX records) must take place inside your registrar's interface.

Email on a connected domain

Connecting a domain for web traffic does not interfere with your email unless you alter existing MX records. If you want to handle incoming messages using thelastapi's mailbox or forwarding tools, you can point your MX records accordingly.

To check what DNS records your domain requires for email delivery:

Terminal
vibiz email dns acmebakery.com --check

To forward incoming email like hello@acmebakery.com to your personal inbox, run:

Terminal
vibiz email forward hello@acmebakery.com ana@example.com

Because the domain was purchased externally, you must copy the MX and SPF records displayed by the CLI to your registrar's DNS panel. If you are replacing an existing mail setup, the --replace-mx flag confirms taking over email handling. Learn more about managing inboxes in our guide on how to forward hello@yourdomain.com to the inbox you already use.

Disconnecting or moving an existing domain

If you migrate to a new name, redesign your architecture, or want to release a custom domain from a project, remove it with a full-access key:

Terminal
vibiz domains remove acmebakery.com

Removing the domain immediately disables HTTPS routing on thelastapi's edge and removes it from your project's allowed origins for authentication. After running the command, remember to clean up or re-point the corresponding records in your registrar's DNS panel.

If your business needs a fresh corporate entity to go along with your domain, see our guide on how to form a US LLC or C-Corp from your terminal: costs and steps and review the Company formation documentation.

Next step

Add your existing domain to your project by running vibiz domains add yourdomain.com, enter the required records into your registrar's DNS management panel, and run vibiz domains verify yourdomain.com to confirm that traffic and HTTPS are active. ===BODY===

Frequently asked questions

Can I manage DNS records using the CLI for a domain I connected from elsewhere?

No. Domains connected from an external registrar keep their DNS zone at that registrar, so commands like `vibiz domains records add` return a `400 invalid_request (dns_elsewhere)` error; you must edit DNS records in your current registrar's dashboard.

How long does it take for HTTPS to turn on after adding DNS records?

HTTPS turns on automatically as soon as your DNS records propagate and verify, which typically takes between one and a few minutes after you run `vibiz domains verify <domain>`.

What does the `--elsewhere` flag do when adding a domain?

The `--elsewhere` flag tells the platform that your app is hosted on an external server rather than our hosting, allowing features like analytics and sign-in to recognize and trust the domain without expecting traffic routing.

Can a Limited API key add and verify a domain?

Yes, a Limited key can run `vibiz domains add` and `vibiz domains verify`; analytics counts traffic right away, while sign-in trusts the domain once the required TXT proof is detected or an owner confirms it. ===FAQ===