Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set the DNS so that the root domain and the subdomain of a gitlab page point to the same address?

This is a question similar to this one, but not identical.


I created a static site with Hugo and hosted it on gitlab.

I own a domain that has been assigned to me by tophost.it, say example.it

As explained in this document, and in particular in this paragraph (*), I created 4 dns:

  1. @ A 35.185.44.232
  2. www CNAME example.gitlab.io
  3. _gitlab-pages-verification-code TXT gitlab-pages-verification-code = ...
  4. _gitlab-pages-verification-code.www TXT gitlab-pages-verification-code = ...

If I type in any browser example.it my site hosted on gitlab opens normally; if instead I type www.example.it I get the following error message:

401

You don't have permission to access the resource.

The resource that you are attempting to access is protected and you don't have the necessary permissions to view it.

What's the mistake? How to correct it? Can those who have a site hosted on gitlab explain to me how they set their DNS to connect their custom domain with and without "www"?

(*): "There are a few cases where you need point both subdomain and root domain to the same website, for instance, example.com and www.example.com. ..."

like image 233
Akira Takeshi Avatar asked Mar 09 '20 13:03

Akira Takeshi


Video Answer


1 Answers

You should check your bindings with the IP address of your domains. Also, note that "www.example.com", www is also a subdomain. However, i advise you to check your binding in DNS zone again and especially check A record.

If it is possible then kindly provide your DNS settings. So, I can suggest you better

like image 157
Palkit Rathod Avatar answered Dec 03 '22 19:12

Palkit Rathod