3

I have already successfully set up a GoDaddy subdomain to point to my personal gh-pages website. This means that my username.github.io webpage is pointing to subdomain.domain.com.

As a consequence of this, all the project gh-pages on my github account are changed accordingly, e.g. a page on repository test-project (which would have been previously hosted at username.github.io/test-project) now is hosted at subdomain.domain.com/test-project.

I would now like to set up my GoDaddy DNS manager in such a way that my test-project gh-page points to a second subdomain, for example project.domain.com.

Now, I know there are plenty of similar questions on stackoverflow, but none of them seems to be solving my specific case. My problem is that I don't know what to add to the CNAME record on GoDaddy. I've tried with both subdomain.domain.com/test-project and username.github.io/test-project , but none of them seems to be working! In particular, if I put username.github.io/test-project, it returns the following error:

Enter either @ or a valid host name such as: "subdomain.domain.tld"

UPDATE I've solved by following this Subdomain of website for Github pages project and having my subdomain CNAME to point to username.github.io. (notice the . at the end). I will do it for any other future subdomain.

Now my question becomes: what does the . do? What does it mean? It is not very clear to me.

alecive
  • 177
  • 1
  • 14

1 Answers1

3

The trailing dot at the end is as per RFC defined for fully qualified domain name.

So actually every domain ends with a trailing dot internally. You can actually check this for any website just add a trailing dot in the domain name you will still get the same page. eg. https://stackoverflow.com./questions/53450113/custom-subdomain-with-project-page-hosted-on-github-pages

So when you make a dns request for domain.com, the browsers stub resolver actually makes a DNS query for domain.com. to the DNS server.

Hop this helps/

mdeora
  • 4,152
  • 2
  • 19
  • 29
  • Thanks for the info. Does that mean that if I used username.github.io (without the dot), it would have worked anyway? – alecive Nov 29 '18 at 15:15
  • 1
    It depends on the provider where you entering this info. I guess for github pages subdomain you have to use the trailing dot. – mdeora Nov 29 '18 at 15:24