I added a subdomain and added a dns record, but it's not working

Greetings,

Thank you for asking.

I am sorry to hear you’re experiencing an issue with your domain/website while using Cloudflare.

Can you share what kind of error code you’re getting or a screenshot of the error you’re experiencing? :thinking:

May I ask if the sub-domain is in form like sub.domain.com or www.sub.domain.com? :thinking:

Before moving to Cloudflare, was your Website working over HTTPS connection and your sub-domains too? :thinking:
May I ask what SSL option have you got selected under the SSL/TLS tab at Cloudflare dashboard for your domain ( Flexible, Full, Full Strict … )?

So, you’re using your local hosts file to access your website/sub-domain? :thinking:
You might find an issue, as far as if your sub-domain related DNS hostname is proxied :orange:, then you’d have an Cloudflare anycast IP - or multiple ones - shown on the lookup.
Therefore, your local hosts file would try to go (including your Web browser cache and possibly a cache at the DNS of your local ISP provider) to an “known” IP address instead of going for the new proxied :orange: one.
Despite, even if you figure out the new IP, it’s an anycast network, meaning it could change the in the next few days or so.

My best guess is, you’re using development website and IP access, and not having an proper and valid SSL certificate for your sub-domain, therefore possibly having an issues like described at the article from below:

Otherwise, some other issue might happen. Please provide some more feedback regarding this case in your next reply so we could troubleshoot further and help you find a proper solution.