Pages: 401, no permission, cannot verify domain although DNS has been set

Hi everyone,

I have typically used Cloudflare with Gitlab Pages and custom domains without any problems. However, in this case I cannot use Cloudflare as this is a side project for a friend, e.g. I cannot make whatever change I want.

The current situation is as follows

  • GL CI pushed the content live
  • CNAME entry has been set, ie. when entering the it shows a GL 401 with “You don’t have permission to access the resource.”
  • Visibility setting was set to Everyone
  • Let’s Encrypt is set to Active

However, the domain cannot be verified.

As per the TXT records has been set. I have actually tried various entries with the same verification code but it’s not working.

I’d appreciate any lead or advise. Thank you.

1 Like

You probably want your entry to read 150 IN TXT “gitlab-pages-verification-code=d4c84966389f4d2b50cb6340fdef04e”
so that it can be verified. May still get an issue with 401 after it is verified though.

1 Like

Yep, the additional www subdomain likely is the culprit here.

The corresponding CNAME is set in DNS.



Depending on the DNS interface, one might leave out the domain suffix and write the following into the zone file:

_gitlab-pages-verification-code.www TXT “gitlab-pages-verification-code=d4c84966389f4d2b50cb6340fdef04e”

or, with key values and web forms in mind:

  • Add a new TXT record
  • Key: _gitlab-pages-verification-code.www
  • Value: gitlab-pages-verification-code=d4c84966389f4d2b50cb6340fdef04e


May also want to try a different DNS provider, Gitlab seems to have good integration with Cloudflare

I have a similar problem with a gitlab page deployed with publii. A similar problem is described here. I configured the web site as described here and the answer by DNS to dig request is correct.
However, I can browse while I get 401 with
Any idea?

First of all, it’d be very nice if you wouldn’t necro-post.
Secondly, create a new thread (tag me if you wish) and provide more information doesn’t work” - nobody can really assist you with such useless information!


I’m sorry for this, I opened a new thread here.