Custom subdomain with project page hosted on Github pages - dns

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.

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/

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.

How can I point multiple domain names to the same GitHub Pages site?

This seems like it should be a trivial task but isn't proving to be one for me...
How should I go about pointing multiple domain names to the same GitHub Pages hosted site?
Example:
I have created an account named test on GitHub and created a repository test.github.io
I bought test.com
I configured test.com's DNS as below
I have told GitHub Pages to enforce https and look out for custom domain test.com
My site is now live on test.com and www.test.com, woohoo!
DNS Config for test.com:
A # 185.199.108.153 (github's nameserver)
A # 185.199.109.153 (github's nameserver)
A # 185.199.110.153 (github's nameserver)
A # 185.199.111.153 (github's nameserver)
CNAME # www.test.github.io (for www redirect)
I would ALSO like example.com (and a few other domains, foo.com, bar.com and foobar.com) to redirect to test.com
How do I do this?
With an apache server, this would be easy, be GitHub Pages only supports static sites.
Any ideas?
As always, thanks for any suggestions!
The ideal place to have this redirect is your DNS provider. You can redirect foo.com, bar.com, etc. or whatever you want to test.com. Alternatively, if you happen to use Cloud Flare, forwarding can easily be setup from there too.
But if you don't want to do that and insist on using Github only, refer to this answer. What you can do in this case is create another repository (other than test.github.io) with same contents and link it to another domain such as foo.com. You can use Github Actions or something to sync your changes from main repo to the others.
Of course, the only drawback of this method is that for every domain you want to link, you'll have to create an additional github repo.
I've accepted #Prahlad Yeri's answer from above, and am just leaving this here so that other's who stumble onto this question can easily figure out how to do this... As mentioned "The ideal place to have this redirect is your DNS provider"
To do this with domains purchased from domain dot com it is VERY simple, and even INSTANTANEOUS! I can imagine with GoDaddy or other providers it will be similar.
On Domain dot com's control panel:
Log into account for the domain you wish to redirect
Go to "Pointers and Subdomains" on the left sidebar
Choose either "URL Standard" or "URL Stealth" from the pointer options, then enter the desired redirect URL in the "Directory" field
Press Save and you're good to go, immediately!
URL Stealth means that your URL will remain as what the user has typed in, and URL standard means it will display the URL of the site that you've directed to. More documentation on pointers and subdomains (for domain dot com) can be found at domain.com/help/article/domain-management-how-to-update-domain-pointers

Can two Squarespace websites be of the same subdomain, with a slash

so my issue is as follows:
I have a website, on one language pointing to a site subdomain.domain.com. I added CNAME records and it points perfectly. I now have another squarespace page that is the clone of the other one, only in a different language. Is there a way to point it to subdomain.domain.com/en , for example, and how would one go about doing this thru squarespace and my hosting sites webmin.
You can't use same subdomain for more than once. But as you own, and have access to that domain you can make different subdomain. So it can be: subdomain.domain.com and ensubdomain.domain.com or even you can have subdomain of subdomain en.subdomain.domain.com. You are probably aware where it goes. You can have something like: you.can.go.as.far.as.you.need.or.you.want.domain.com. ( be aware that you need to check with host first, what is included in your package or maybe do you have some limits)

Domain name point to subdomain of a entire different domain

I am completely confused the last few days with this and I still haven't found an outcome that's worked.
Basically I have a domain name without hosting at letshost.ie which is dublinplasterer.ie
I also Have one domain & hosting with godaddy for domain- shanafagan.com which is my own site for web/graphic design service.
I created a subdomain= dublinplasterer.shanafagan.com and uploaded the site files.
Basically I want for example when someone types in dublinplasterer.ie in the address bar if goes to dublinplasterer.shanafagan.com but doesn't show dublinplasterer.shanafagan.com url, stays as dublinplasterer.ie
Im not even sure if this can be done at this stage. head is melted
shanafagan.com and the subdomain dublinplasterer.shanafagan.com have the same ip so how will that work if changing dns?
Any help would be greatly appreciated , am so stuck at this stage.
If you wanted to do it this way you would need a web server for domain2.com
Search for ProxyPass.
The way you should do this is add a second domain on your web hosting (cpanel for example) and point the other domain to this web server.
If you are struggling I recommend using a solution like cPanel that is widely used and simplifies much of the process. It is common enough you can google most issues.
So normally you would have started by making an add-on domain (instead of a subdomain) which would also create it's own subdomain anyway. To do that, you go to your cPanel in GoDaddy and find add-on domain, then make it "dublinplasterer.ie" (Don't add www. to it. Even though this name is hosted elsewhere, we will later go to your DNS files at that hosting and point it to your GoDaddy's name servers and this add-on helps it direct to the right root folder) then choose your local root folder for that site (I think you can actually make this the same as your other subfolder already hosting your files and then it will just pull the same site) or you can pick a different subfolder and then make the add-on domain. This tells any request to this name server that if it is a request for "dublinplasterer.ie" it needs to send it to the subfolder you specified.
If you don't make the subfolder the same as the one you already made, you can either load the same content into your new subfolder or create a CNAME record telling this add-on to point to your subfolder instead but that is more complex so go with the other route.
Lastly, you need to go to your original hosting at letshost.ie and under your domain name find the DNS records tab. Change the name servers to match your GoDaddy ones and now (may take a day or two to show as DNS changes often take days and can't be seen immediately but you can try using a different device/computer/mobile that hasn't loaded it previously to see if it will refresh the correct dns) it should work. Even though it points to your main site name servers, the add-on domain you made receives it and directs it to the subfolder you specified on the add-on domain.
Hope that helps, let me know if it works for you.

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.

Resources