Wildcard Domain and Dynamic DNS Cloudflare

I have purchased and hosted a domain through Cloudflare. (example.domain)

I currently have two type A records in my DNS records. They are router.example.domain and vpn.example.domain. These IP addresses are updated through the Dynamic DNS feature built into pfSense. I am then using ACME to generate certs for those domains. These are working correctly.

I am looking to setup a Jellyfin/Plex server and Synology and want to use HAProxy to handle the certificates and everything will be accessed internally only, I’m not exposing anything to the internet.

However. I don’t want to keep adding A records to my DNS for every subdomain. So I am attempting to point a wildcard (*.example.domain) to my pfSense router using the DynamicDNS feature, but it is failing. The dynamicDNS service is not syncing with Cloudflare. The pfSense documentation mentions about enabling Wildcards for the dynamic DNS but I don’t see a check box for that when setting up the dynamic DNS entry in pfSense.

I’m also not sure if I need to remove the other 2 dynamic DNS entries to get the wildcard to work or if they can coexist.

The way I typically do this is to make the wildcard a CNAME record pointing to the real record that’s linked to dynamic DNS. It can even look like an A record externally if you use Cloudflare’s CNAME flattening setting.

If I understand you correctly you are saying to create a CNAME record of * example.domain and then point it towards an A record like wildcard.example.domain and then update that record with the dynamic DNS process?

You got it! I’m fond of hq.example.com or home.example.com. Set that one A record to be updated from your router’s dynamic DNS and then everything else (including a wildcard) can point to that base subdomain via a CNAME.

Can confirm that this worked for me once I used the correct API key in the dynamic dns application.