I'm playing with basic hosting and DNS. I have a static page hosted at example.github.io which is referenced by a CNAME at example.com which is the URL I want visitors to see.

I want to use various tools (Google Search Console, Bing Webmaster Tools, 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 example.com 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).


  • Is it possible to add TXT records to a static site hosted on GitHub?

  • Have I revealed some fundamental misunderstanding about DNS, and can you point it out where I've gone astray?

  • Is this just not possible?


1 Answer 1


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.

  • 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/… Sep 9, 2020 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. Sep 10, 2020 at 20:35

Your Answer

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

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