Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gitlab Pages: Failed to verify domain ownership

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!

like image 454
Oliver Fawcett Avatar asked Feb 21 '18 18:02

Oliver Fawcett


3 Answers

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

like image 128
bozdoz Avatar answered Sep 17 '22 17:09

bozdoz


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.

like image 25
Martin Trenkmann Avatar answered Sep 20 '22 17:09

Martin Trenkmann


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

like image 40
ryu Avatar answered Sep 19 '22 17:09

ryu