I don't understand the docs' instructions on applying a second domain

Hello! Long time listener, first time account-holder.

Anywho, I can’t quite figure out what the docs are telling me — my goal is:

  • I own two domain names: domain1 and domain2 (so creative)
  • I’ve succeeded in getting domain1 to point to my Netlify site (hooray!)
  • I’ve not succeeded in getting domain2 to also point to the same site, where my preference is:
    • When someone types domain2, they just go to domain1
    • The URL changes to domain1, in their address bar

Things that might be helpful to share:

  • In the domain registrar (for both domains), I’ve updated them to point to the name servers provided by Netlify.
  • I’ve chosen to use Netlify to manage DNS, rather than the domain providers.

Below are screenshots of what I see—what the docs have pointed me to … but it’s the last screenshot that confuses me (some of the help text, near form fields, is unclear to me).

I’m sure I’m just a noob and it hasn’t clicked, yet. Thanks for any assistance any of you might provide!

  1. https://www.dropbox.com/s/00gtn79a0jc03pv/domains-1.png?dl=0
  2. https://www.dropbox.com/s/gm878kygu40o4xt/domains-2.png?dl=0
  3. https://www.dropbox.com/s/oal12rbcoec1eyn/domains-3.png?dl=0

Hey, thanks for reaching out.

I think the best source of knowledge for this is the Sites with multiple domains doc which will help you with setting up domain aliases (multiple custom domains pointing to one site).

Thank you for replying @Pie!

I’ve been to that page (and the one it leads to [ https://docs.netlify.com/domains-https/custom-domains/#assign-a-domain-to-a-site ]), but neither of them seem to clarify what I need to type in my third screenshot above, where there’s a form in which I’m supposed to enter ALIAS information.

What I can see is that your second domain isn’t being served by Netlify DNS. Have you configured the correct nameservers?

Hmm, maybe it did it wrong over at the domain provider for domain2? Attached is what I’ve got, over there:

You’ll need to ensure that these are the 4 records that the Netlify UI is prompting you to add :slight_smile:

Confirmed! Those are the 4 records that the Netlify UI says to add. They’ve been assigned over in the domain provider since yesterday afternoon.

I feel like the thing I’m missing has to do with my second screenshot ( https://www.dropbox.com/s/gm878kygu40o4xt/domains-2.png?dl=0 ) — I can’t figure out if I’m supposed to be doing something with those values … perhaps adding them, somehow, to the form seen in my third screenshot ( https://www.dropbox.com/s/oal12rbcoec1eyn/domains-3.png?dl=0 )?

Hi Marcamos,

Your second domain is missing from https://app.netlify.com/sites/[sitename]/settings/domain. If you add the second domain and then ensure that your NS records match, the records will be automatically added to the Domains UI within the specific site when you add the domain alias again.

Note: hit the Renew Certificate option at the bottom of that page once all of your changes are made, to ensure that your Let’s Encrypt certificate covers the domain alias :slight_smile:

Ooo maybe we’re getting closer; are you referring to the two blue ones here: https://www.dropbox.com/s/00gtn79a0jc03pv/domains-1.png?dl=0

Wait, I think I’ve got it. It looks like (someone, not me?) fixed me up by adding domain2 to https://app.netlify.com/teams/marcamos/dns

…and that might’ve been the piece I didn’t know I needed to do.

OK @Pie, most of the above is now working, except for one detail: going to domain2 loads the Netlify-hosted site (yay), but the URL stays domain2. I would love for it to insta-swap to domain1. Is it possible for me to change that in the Netlify interface, somewhere?

Thank you, again, for your assistance!

Hey! Pleasure’s all mine :grin:

Have a read through this – How to forward a Netlify domain to my other Netlify domain? – it’s an interesting discussion and should lead you where you need to be!

Aha, the _redirects file in my public folder – perfect. I threw…

https://domain2.com/ https://domain1.com/ 301

…in there and it works perfectly. Thank you, case-closed!

1 Like