Resolving a domain to subdomain on cloudflare

wordpress

#1

Hi there, I am stuck getting my domain to resolve to a subdomain. I am wondering if someone can help me with this issue.

I have a domain called (domain.com) I created a sub site under that domain called (sub.domain.com)
Under domain.com in the cloudflare dns settings, I created a wildcard CNAME record. I have also created a subdomain record both pointing to my domain.com

Using Cloudflare, I then added another site (domain2.com) to resolve to the subdomain. I deleted the A record and created a CNAME record. (CNAME domain2.com is an alias of sub.domain.com).

I waited a period of time with no luck. I can access the subdomain using (sub.domain.com) but does not resolve when accessing using (domain2.com)

I get a message with Error 520 web server is returning an unknown error.

Thank you for your help