1

Github allows to serve content for a custom domain from user's repository.

Documentation describes how to configure www subdomain, and it also describes how to configure apex domain, like example.com

But how to configure both?

This is the documentation:
https://docs.github.com/en/pages/configuring-a-custom-domain-for-your-github-pages-site/managing-a-custom-domain-for-your-github-pages-site

  • I configured apex domain and it works, but I can't configure www subdomain, it fails with DNS_PROBE_FINISHED_NXDOMAIN, site can't be reached.

  • I tried to create CNAME record to redirect www request, but it doesn't work.

  • Redirecting www to apex doesn't work.

  • Redirecting www to username.github.io also doesn't work.

What would be the right way to configure DNS so that Github's pages serve both www subdomain and apex domain?

I went through some answers here and on the web. And found some suggestions using ALIAS, my provider doesn't support ALIAS. Do I have to switch provider or is there another solution?

EDIT:

I'm adding information as requested in comments

Domain http://www.halza.de redirects to halzade.github.io

dns config:

dns setup

I added cname for www with value halza.de. With dot at the end.

1
  • 1
    I would help (as for any DNS troubleshooting question) A LOT if you give the real domain name involved or at least EXACTLY what configuration you used. At the DNS level, an A entry for the apex, and a CNAME for the subdomain should be all what is needed to make things work. That is all on the DNS side, and then the rest is a matter of the website getting requests. Which is basically what the section "Configuring an apex domain and the www subdomain variant" on the link you gave says, so hard to know exactly your problem with so little details in your question. Feb 15 at 18:19

1 Answer 1

1

The problem was that my DNS provider UI used field value as a name of another subdomain, I had to add dot . at the end of the CNAME record value, which fixed the problem.

1
  • 1
    Knowing the domain someone could have told you so 2 days ago :-) To get out with learning something new in DNS: an end dot makes the name absolute, otherwise it is relative to the zone it is into. Various UI/API handles things differently, but this trailing dot handling comes from core DNS specifications. Said differently, if you are in zone example.com, then www CNAME admin means www.example.com will resolve as admin.example.com, where if you had www CNAME admin.whatever.example. then www.example.com would resolve as admin.whatever.example Feb 15 at 21:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.