3

Context

I'm playing with basic hosting and DNS. I have a static page hosted at blackboxlogic.github.io which is referenced by a CNAME at alexhennings.dev which is the URL I want visitors to see. I want to use various tools (google search console, bing webmaster, keybase proof) which require I prove ownership of the domain by adding a TXT record with a unique identifier for each service. I've added the TXT records to alexhennings.dev but it "isn't working"*, which makes some sense to me, since CNAME and TXT records can't cohabitate. I haven't found a way to add TXT records directly to the github page since the name server isn't under my control.

"Isn't Working"

The webmaster tools find the TXT record, but are not showing any information about the site or its content, as if they aren't finding it. KeyBase has told me that it doesn't see the TXT record at all (it worked momentarily when I removed the CNAME, but that broke the site).

Questions

  • Is it possible to add TXT records to a static site hosted on github?
  • To get feedback from webmaster tools about my site/content, should I be proving ownership of alexhennings.dev or blackboxlogic.github.io?
  • Have I revealed some fundamental misunderstanding about DNS, and can you point it out where I've gone astray?
  • Is this just not possible?
2

You can't use a CNAME at your domain apex (the @ record for no subdomain) regardless of whether or not you also want TXT records. It breaks all other needed records like NS, SOA, and MX records. DNS servers shouldn't even allow you to put a CNAME record at the apex. If you manage to do so, things break subtly. For example your domain's email will not be properly delivered.

Instead of using a CNAME you need to use A, AAAA, or ALIAS records according to instructions from Github.

Once you have properly configured your DNS such that it doesn't have a CNAME record at the apex, you can add TXT records to verify your site.

| improve this answer | |
  • 1
    Seconded. CNAME records on the bare domain name are non-standard, and a recipe for trouble. Almost all DNS providers prevent you from doing it. More details in this ServerFault thread: serverfault.com/questions/613829/… – Maximillian Laumeister Sep 9 at 21:29
  • NameCheap happily let me put a CNAME on the apex. I've replaced the CNAME with an ALIAS, and I've verified that each webmaster service seems to work (finds the TXT record) and the redirects still work the way I wanted. Thank you. – blackboxlogic Sep 10 at 20:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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