BUG REPORT: System validates wrong CNAME record for flattened naked domains (Cloudflare example)


There’s no Bug Report section, so I’m posting it here.

I discovered why pointing your site to a custom naked domain sometimes fails. The system is validating flattened naked domains using the wrong DNS record: Instead of the CNAME for the naked domain it uses the CNAME for the www.

It’s probably due to the fact that flattened CNAMEs act as A records, so the system fails to locate a CNAME record for the naked domain and never tries to look for an A record for it, jumping to the CNAME of the www instead.

Below are the steps to verify/reproduce the issue.

How to reproduce the bug

  1. Create a CNAME record pointing to your 000website. I used Cloudflare, which automatically flattens the CNAME of the naked domain. Don’t create the record for the www yet.

  2. Check if it propagated. The CNAME will fail, but the A record will show IP addresses from 000webhost.

  3. You can also try to visit your custom domain for good measure. It’ll confirm you’re reaching the 000 servers by displaying the following page.

  4. Go to the control panel and try to point the domain. It’ll fail. You can wait over 48 hours to make sure the DNS cache updated if you wish, it’ll still fail.

Using the www CNAME to validate the flattened naked domain

  1. Create a new CNAME record pointing the www to the 000website on Cloudflare.

  2. If you want to prove beyond any doubt the system is validating the naked domain using the www CNAME delete the naked domain CNAME record and wait until the DNS cache updates. You can check if it’s gone by checking the A record for the naked domain.

  3. Go to the control panel and try to point the site to the naked domain. Remember, it shouldn’t work because you have no CNAME record for it. You’ll get the confirmation it’s validating using the www CNAME instead because it’s the only one pointing to 000webhost now.

Success! The system will add both the naked domain and the www by default.


A post was merged into an existing topic: How To Use Cloudflare For SSL