Gitlab pages: verify domain ownership - dns

This might look like a duplicate but i can't seem to find the answer to this question on other similar threads.
I've been trying to verify my custom domain on gitlab pages but it keeps giving the 'failed to verify domain ownership' error. My DNS settings are set like this. On gitlab i've added the domain in the settings/pages tab.
When going to the domain now, it only shows a gitlab 404, which is the exact same as just entering '52.167.214.135' in the address bar. I've waited a few days for the verification.
What am i doing wrong, and how can i fix it?
(Note: The TTL of 1min is only temporary for testing purposes)

The Gitlab documentation for setting a personal domain is wrong. If you want to set to your page the www.foo.bar subdomain Gitlab give you this entries to add in your DNS file.
www.foo.bar CNAME free_zed.gitlab.io.
_gitlab-pages-verification-code.www.foo.bar TXT gitlab-pages-verification-code=776615a3e132b0f5a6638c7e26e59084
This cannot work, you had to use these entries instead : 
www CNAME free_zed.gitlab.io.
_gitlab-pages-verification-code.www TXT gitlab-pages-verification-code=776615a3e132b0f5a6638c7e26e59084
See Gitlab pages issue

Related

Github user page and project page in different subdomains of the same domain?

So what I am trying to get done is:
Have UserName/username.github.io served at https://subdomain.domain.com
Have Username/project served at https://project.domain.com
I have done these things:
Put a DNS record in cpanel: subdomain CNAME username.github.io.
Put a CNAME file subdomain.domain.com in UserName/username.github.io repo.
Put a CNAME file project.domain.com in UserName/project repo.
Now number 1 works: https://subdomain.domain.com is reachable and serves the content correctly.
However 2 does not work: DNS check fails:
Your site's DNS settings are using a custom subdomain, project.domain.com, that's set up as an A record.
We recommend you change this to a CNAME record pointing at [YOUR USERNAME].github.io.
For more information, see Learn more (InvalidARecordError).
We recommend you change this to a CNAME record pointing to subdomain.domain.com.
Now if I follow the suggestion then I get UserName/project served at subdomain.domain.com/project correctly, but that is not what I want.
I followed this question, of which this one should be a duplicate... but I guess there is something different, or something I am missing.
How do I fix this ?
Trying to put another DNS CNAME record: project CNAME username.github.io.
It should work.

Heroku app not working with custom domain

I deployed a node app on heroku and pointed a custom domain to it from namecheap. When I type my domain in it will load a page that says "Theres nothing there, yet" and changes the url to domain.com.herokudns.com
After looking around for 2 days I came back to the same solution, I created two cname records on namecheap that pointed to the "domain.com.herokudns.com". The cname records automatically place a period after this target, when I place a period after my domain when searching, my website loads.
Is there a way to fix this? I've seen people with similar problems but I find it weird that my site will load both with www and without if I have a period at the end.
I had to change the cname record to a www name with the target of [herokuappname].herokuapp.com and add a url redirect # to http://[www.yourdomain.tld]. After clearing my cache this worked.

GitHub Pages: setting up custom domain

I've got an organization page set up and running in GitHub and things seem to be working...but I'm a little confused. I'd like to actually understand the process since the GitHub Help article refers to taking advantage of their CDN and DoS services, so bear with me.
Step 1: Created CNAME file in repo with domain 'example.com'
Step 2: Grabbed IP from dig example.github.io +nostats +nocomments +nocmd
Step 3: Entered IP from Step 2 into the 'A' record (see image below)
I decided to stop here and see where it got me, and to my surprise it seems to have done the trick. The example.github.io domain correctly redirects to the example.com domain and displays the content from the repo.
However I was informed that after the DNS props, you can dig example.com and see the CNAME record pointing to example.github.io. I do not see this, and I dislike thinking that I didn't set things up correctly. Any thoughts/comments/tips welcome, thanks!
In order to take advantage of the CDN and DoS services provided by GitHub Pages, you'll need to set up a Subdomain (eg www.example.com or blog.example.com) instead of an Apex domain (example.com).
From the GitHub Help page you referenced:
If you are using an apex domain (example.com) instead of a subdomain
(www.example.com) and your DNS provider does not support ALIAS
records, then your only option is to use A records for your DNS. This
will not give you the benefit of our Content Delivery Network.
Here's a setup (looks like you're using GoDaddy for DNS) that would work to get your Organization Pages working as desired:
This is actually for a Project Page within an Organization, but for either one, you'll set the CNAME record for www to organization.github.io, not something like organization.github.io/project. Don't change the A record for # (mine is the default from GoDaddy).
If you want to get your Apex domain (example.com) to redirect to the new subdomain (www.example.com), then you can point your Apex to your subdomain with Domain Forwarding like this:
With that setup, you'll get to take advantage of GitHub's CDN, which you may notice is provided through fastly. Here's how my domain looks to dig:
It is also possible to use a CNAME record for an APEX domain using the free DNS service provided by CloudFlare in which case you can also use your domain without the www (or any other subdomain) and still benefit from CDN & DoS.
I've written a step-by-step guide here: Speed up your GitHub Pages website with CloudFlare
PS: Apparently using ALIAS records is a bad idea... click here to see why.
DNS records are publicly available. There's no way of masking them in this instance. From the way you describe it, you have done everything right. There is nothing that makes me thing you set this up incorrectly.

Github pages with custom CNAME security

Github allows you to host static pages on your own domain name. The procedure is described here: https://help.github.com/articles/setting-up-a-custom-domain-with-pages
It mentions that you have to create a file called CNAME in your repository to make sure your domain is mapped to this repository.
What would happen if someone else would create a pages repository with your domain name in their CNAME file? Would they be able to hijack your domain this way, or will Github forever associate this domain name with your repository?
First of all, if you take the CNAME first, you're safe. GitHub Pages will raise an error to anyone who would try to create the same CNAME file. This if a bit frustrating with forking such repository.
On the second hand GH Pages recently added an option to set DNS to a specific account, using CNAME DNS record instead of A like this:
www.example.com CNAME username.github.io
Checkout the page you mentioned for more info: https://help.github.com/articles/setting-up-a-custom-domain-with-pages
Currently accepted answer is partially wrong.
Yes, you are safe as long as you claim domain name first and as long as it is set up in you repository.
But linking CNAME to specific account just does not do anything. It could work in past, but now it is simply broken. Even if you set up CNAME with your account name, anyone can still use your domain if you did not set it up in your repository. You can check my detailed post about this problem here.

Not able to set my domain name

I am trying to map my site which is on github pages (tusharmath.github.io) to a particular domain (tusharm.com) using cloudflare name servers.
Its been more than a day and i can still not see view my website on tusharm.com
Steps followed -
Added a CNAME file with value tusharm.com in the gh-pages branch on github.
Updated name servers on CrazyDomain that were provided by CloudFlare.
tusharm.com is loading the same content as tusharmath.github.io at this time, which would lead me to believe you were able to fix things here. Did you need to make any further changes to get this working?
p.s. I work for CloudFlare.

Resources