Note: This documentation is for version 1 of the Now platform. For the latest features, please see the version 2 documentation. If you have yet to upgrade, see the upgrade guide.

Aliases and Domains

This guide covers how to assign two types of domains to your Now deployments.

  1. Subdomains under .now.sh (for example https://hello.now.sh)
  2. Entirely custom domains (for example https://your-company.com)

Whenever you deploy to Now, the URL you get in return looks something like:

https://get-started-basic-etjnigdrkz.now.sh

We can split the above URL into few parts:

  • https:// -Every single deployment is automatically served under HTTP/2 with SSL. Certificates are automatically provisioned.
  • get-started-basic - The application's name. You can customize it upon deployment (for example with the name field in package.json for Node.js deployments or LABEL in Dockerfile for Docker ones.
  • etjnigdrkz - A cryptographically-strong random string that makes your URL virtually impossible to guess, while retaining a reasonable length for sharing it with your co-workers or clients.
  • .now.sh - All your deployments end in .now.sh by default. Aliases allow you to point them to custom domains.

These URLs are ideal for development and staging, but not ideal for end users.

‚ÄčNow aliases have two purposes:

  1. Giving your deployment a friendly and memorable name.
  2. Updating deployments with zero downtime.

Aliases are managed by invoking the command now alias, which has the following syntax:

now alias <SOURCE URL | ID> <TARGET SUBDOMAIN | DOMAIN>

For example, let's say you want https://get-started-basic-etjnigdrkz.now.sh to be accessible by the alias get-started-basic.now.sh.

All you have to do is run:

now alias https://get-started-basic-etjnigdrkz.now.sh get-started-basic
> Success! Alias created (CIyk6IKL8MIHzAqrmcxbM8kf): https://get-started-basic.now.sh now points to https://get-started-basic-etjnigdrkz.now.sh (xpvB6GZWMR6Q9Oxe3c64Htgq) [copied to clipboard]

After this successful message, your deployment is instantly available via its original URL and the new alias you gave it:

The URL get-started-basic.now.sh now works!

Notice that we omitted .now.sh at the end of the target subdomain. When one is not given, we default to now.sh.

As seen in the output, each alias receives a unique identifier. In the example above, it's xpvB6GZWMR6Q9Oxe3c64Htgq.

It's usually known as the deployment ID, which is also accessible when you list your deployments with now ls. It can be used in substitution of the URL when running now alias:

now alias xpvB6GZWMR6Q9Oxe3c64Htgq get-started-basic

For convenience, we parse the URLs you supply as parameters to now alias to extract the hostname, which means the following are all valid source URLs:

  • Just the hostname: get-started-basic-etjnigdrkz.now.sh
  • Including http(s): http://get-started-basic-etjnigdrkz.now.sh
  • Including /: https://get-started-basic-etjnigdrkz.now.sh/

The same mechanism we explained above can be used to configure a custom domain.

The command is almost exactly the same:

now alias https://get-started-basic-etjnigdrkz.now.sh your-company.com

If your-company.com is available to buy, Now will allow you to buy it directly from the command line, which is the only step you need to do. Now will take care of all the domain configuration.

Otherwise, you need to configure the domain name for Now. You can either use our global DNS service or add an ALIAS/CNAME record on your existing DNS solution.

Refer to this guide for more information on domain configuration.

We ensure that your domains are fully protected and only you can alias to them.

When you add an alias to a certain domain name, we first verify its ownership. If it's not been claimed by anyone, we associate it with your account.

After executing the alias above, just run now domains ls to see all the domains in your account:

now domains ls
> 2 domains found [214ms] id dns url verified created zXBxQLQYidDddAb2l6db26Cb zeit.worldhttps://your-company.com true 11m ago WAZjIaxvaiieNUqJc22PJUKG externalhttps://zeit.run true 20m ago

As you can see, there are two types of domains:

  • external: the domain is associated with a third-party nameserver provider like DNSimple.
  • zeit.world: the domain is hosted with zeit.world and now alias automatically sets up records.

Once a domain appears under now domains ls, only you can point aliases to it until you remove it from your account.