Gitlab Pages: Failed to verify domain ownership
Asked Answered
Z

6

19

This morning I got emails for each of my Gitlab Pages that are hosted on custom domains, saying that the domain verification failed.

That's fine, because I don't think I ever verified them in the first place - good on Gitlab for getting this going.

When I head on over the the Settings>Pages>Domain_Details on each repo, I see the instructions to create the following record:

_gitlab-pages-verification-code.blog.ollyfg.com TXT gitlab-pages-verification-code={32_digit_long_code}

On creating this record, and clicking the "Verify Ownership" button, I get the message "Failed to verify domain ownership".

I have ensured that the record is set, and calling

dig -t txt +short _gitlab-pages-verification-code.blog.ollyfg.com

Returns:

"gitlab-pages-verification-code={same_32_digit_long_code}"

Is this a bug in Gitlab? Am I doing something wrong?

Thanks!

Zenaidazenana answered 21/2, 2018 at 18:29 Comment(3)
Wait 24 hours for propagation of DNS and try again.Fully
Seeing the same thing here, except using a rootlevel TXT instead of the _gitlab-pages-verification-code. subdomainWester
Probably it did not propagate to one of your secondary dns servers and GitLab was using this exact slave for verification. At least I think that is what caused trouble in my case. Verification succeeded after I removed the stale server from my zone.Willingham
R
7

Wait for sometime, it worked for me. Initially, having the same problem as you mentioned.

Also, you may find this page useful: https://gitlab.com/help/user/project/pages/getting_started_part_three.md#dns-txt-record

It might be worthwhile, trying with: blog.ollyfg.com instead of: _gitlab-pages-verification-code.blog.ollyfg.com

Radiolocation answered 21/2, 2018 at 23:25 Comment(1)
To make things more clear, as @Radiolocation mentioned, this issue may be caused because of the multiple purposes of the domain - (email, non-gitlab usage, etc.) I've faced same issue when trying to use the subdomain. To resolve it, I've changed my DNS record to the type A, and added DNS TXT record with a key provided by gitlab. It finally helped. subdomain.domain.zone A 52.167.214.135 subdomain.domain.zone TXT gitlab-pages-verification-code=your_code_hereValencia
Z
15

The docs (and the verification page) were a little confusing for me. Here's what worked for me, on GoDaddy:


A Record:

Name: @

Value: 35.185.44.232

CNAME:

Name: example.com

Value: username.gitlab.io

TXT Record:

Name: @

Value: gitlab-pages-verification-code=00112233445566778899aabbccddeeff


Verified with Gitlab, and also:

dig -t txt +short example.com

Zygospore answered 17/1, 2019 at 4:25 Comment(7)
don't need the CNAME record if you didn't use any subdomain. And don't need A record if you use subdomain. Worked for me in both case.Jobie
@Atiq In fact, I did need both A and CNAME for it to work, and I am not using a subdomain.Zygospore
Interesting. I configure it today and i didn't need cname for my domain. may be they update the system.Jobie
But why @ for name when according to GitLab must be _gitlab-pages-verification-code.gms-ai.com?Listed
Not sure about this @VitalyZdanevich maybe they changed their documentation againZygospore
The @ in the TXT record made all the difference for me, many thanks!Sillabub
It solved my issue as well (for DreamHost registrar). I use both top-level domain and subdomains.Whack
C
10

Here is how to get a subdomain.domain.com point to namespace.gitlab.io/project-name with Gandi.

The CNAME and TXT records generated by GitLab when adding a new subdomain to a project via Settings > Pages > New Domain did not work in my case. The exact non-working records were mysubdomain.mydomain.com CNAME mynamespace.gitlab.io. and _gitlab-pages-verification-code.mysubdomain.mydomain.com TXT gitlab-pages-verification-code=00112233445566778899aabbccddeeff.

Modifications like mysubdomain CNAME mynamespace.gitlab.io. (with and without a dot at the end) did not work, either (ping mysubdomain.mydomain.com said unknown host).

Using an A record and a TXT record with only the subdomain in the record's name field does work in my case. Here are the exact working records:

mysubdomain 1800 IN A 35.185.44.232
mysubdomain 1800 IN TXT "gitlab-pages-verification-code=00112233445566778899aabbccddeeff"

Note that the namespace.gitlab.io IP address has changed from 52.167.214.135 to 35.185.44.232 in 2018.

Wait as least 30 minutes to get the records propagate.

In my case GitLab also verified the domain automatically, I did not need to click the Verify button.

Calvert answered 11/9, 2018 at 15:10 Comment(3)
Me too. And just in case someone as ignorant as me is also wrestling with this: I was able to map two different Gitlab pages projects to two subdomains of the same DNS: en.example.org to namespace.gitlab.io and fr.example.org to namespace.gitlab.io/french. The documentation seemed to suggest that I needed CNAME records to do this, but I followed these instructions and used A records, and it worked.Submerge
This answer helped me a lot, thanks. However, I like to add here another issue I encountered with a specific subdomain WWW. Recommended method is failed for me as Gandi is not allowing a TXT type entry for WWW (quite normal IMHO). So instead of changing _gitlab-pages-verification-code.mysubdomain.mydomain.com to m̀ysubdomain, I changed it to _gitlab-pages-verification-code.mysubdomain and it works. BTW, this is related with how Gandi handles DNS entry names, it always adds mydomain.com. It is clear when you edit DNS records in table mode, but not obvious in text mode.Sackman
@Sackman can confirm your method worked for www on google domains; nothing else I've tried here worked!Blumenthal
R
7

Wait for sometime, it worked for me. Initially, having the same problem as you mentioned.

Also, you may find this page useful: https://gitlab.com/help/user/project/pages/getting_started_part_three.md#dns-txt-record

It might be worthwhile, trying with: blog.ollyfg.com instead of: _gitlab-pages-verification-code.blog.ollyfg.com

Radiolocation answered 21/2, 2018 at 23:25 Comment(1)
To make things more clear, as @Radiolocation mentioned, this issue may be caused because of the multiple purposes of the domain - (email, non-gitlab usage, etc.) I've faced same issue when trying to use the subdomain. To resolve it, I've changed my DNS record to the type A, and added DNS TXT record with a key provided by gitlab. It finally helped. subdomain.domain.zone A 52.167.214.135 subdomain.domain.zone TXT gitlab-pages-verification-code=your_code_hereValencia
J
4

I really get a hard time to make it work. But in the end below settings worked for me.

GoDaddy

domain.com

A record

+-----------+---------------------+
|   Host    |          @          |
+-----------+---------------------+
| Points To | 35.185.44.232       |
+-----------+---------------------+

To Verify your domain Add TXT record

TXT record

+-----------+-----------------------------------------------------------------+
|   Host    |                                @                                |
+-----------+-----------------------------------------------------------------+
| TXT Value | gitlab-pages-verification-code=00112233445566778899aabbccddeeff |
+-----------+-----------------------------------------------------------------+

subdomain.domain.com

CNAME record

+-----------+---------------------+
|   Host    |  subdomain          |
+-----------+---------------------+
| Points To | namespace.gitlab.io |
+-----------+---------------------+

To Verify your domain Add TXT record

TXT record

+-----------+-----------------------------------------------------------------+
|   Host    |             _gitlab-pages-verification-code.subdomain           |
+-----------+-----------------------------------------------------------------+
| TXT Value | gitlab-pages-verification-code=00112233445566778899aabbccddeeff |
+-----------+-----------------------------------------------------------------+

Note subdomain and verification code will be found under settings>page (create/details) GitLab Pages IP on GitLab.com has been changed from 52.167.214.135 to 35.185.44.232 in 2018

Jobie answered 20/3, 2019 at 9:58 Comment(0)
M
4

For GoDaddy (April 2020), I had to do the following:

|Type |Name                           |Value                                      |
-----------------------------------------------------------------------------------
|A    |example.com (or @)             |35.185.44.232                              |
|TXT  |_gitlab-pages-verification-code|gitlab-pages-verification-code=blahblahblah|
|A    |www                            |35.185.44.232                              |
|CNAME|www.example.com                |example.gitlab.io                          |
|TXT  |_gitlab-pages-verification-code|gitlab-pages-verification-code=blahblahblah|
|     |(or _gitlab-pages.verification-|                                           |
|     |code.www)                      |                                           |

While the documentation said to use _gitlab-pages-verification-code.example.com and _gitlab-pages-verification-code.www.example.com, those did not work for me, and I could see within seconds after changing and re-checking my verification status that it changed from unverified to verified, and vice versa.

Machzor answered 14/4, 2020 at 4:38 Comment(1)
docs.gitlab.com/ee/user/project/pages/…Disuse
T
0

It's 2021, and this issue still happens. Can't verify domain with gitlab's suggested CNAME and TXT. Had to use on godaddy:

subdomain A 35.185.44.232
subdomain TXT gitlab-pages-verification-code=####
Tamandua answered 3/2, 2021 at 16:25 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.