The same mechanism we explained above can be used to configure an external domain.
The command is almost exactly the same:
now alias https://get-started-basic-etjnigdrkz.now.sh zeithq.com
I already registered the domain zeithq.com, so I'll go ahead and run that command.
> zeithq.com is a custom domain.
> Verifying the DNS settings for zeithq.com (see https://zeit.world for help)
> Resolved IP: none
> Nameservers: ns-cloud-d1.googledomains.com, ns-cloud-d2.googledomains.com, ns-cloud-d3.googledomains.com, ns-cloud-d4.googledomains.com > Error! Please make sure that your nameservers point to zeit.world.
> Examples: (full list at https://zeit.world)
> - california.zeit.world 220.127.116.11
> - newark.zeit.world 18.104.22.168
> - london.zeit.world 22.214.171.124
> - singapore.zeit.world 126.96.36.199
> Alternatively, ensure it resolves to alias.zeit.co via CNAME / ALIAS.
With now there's no manual configuration of DNS records and domain zones. The only requirement is that you point your domain's nameservers to any of our zeit.world hostnames.
In this case, my domain is registered with Google Domains, so I edit the nameservers there to look like this:
If you want to use a domain that's configured with a third party DNS system, you can still use now alias.
To do so, just create a CNAME or ALIAS record that points to alias.zeit.co. For this example, I'll configure hello.zeit.run to point to the same deployment I used above, but using Google's nameservers. First, I head to the DNS settings and add a CNAME record for the hello subdomain as follows:
Next, I run now alias:
now alias get-started-basic-etjnigdrkz.now.sh hello.zeit.run
> hello.zeit.run is a custom domain.
> Verifying the DNS settings for hello.zeit.run (see https://zeit.world for help) > Error! Verification required: Please add the following TXT record on the external DNS server: _now.zeit.run: ed24d6ddc87ee58332ac358ae
As you can see, as a security measure we require that you validate that you own this domain name. So I add an extra TXT record accordingly:
We ensure that your domains are fully protected and only you can add aliases 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 I executed the alias above, I can run now domains ls to see my domains:
now domains ls
> 2 domains found [214ms]
id dns url verified created
zXBxQLQYidDddAb2l6db26Cb zeit.world https://zeithq.com true 11m ago
WAZjIaxvaiieNUqJc22PJUKG external https://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, it means that only you can point aliases to them. For external domains this requires verification. For zeit.world, make sure to add an alias to the domain or run now domain add as soon as possible.