Traefik error 400: DNS problem while deploying portainer with wildcard subdomain

I am new to Traefik and i'm trying to deploy portainer with a reverse proxy and letsencrypt: i used the same configuration on the starting guide (Deploying Portainer behind Traefik Proxy - Portainer Documentation). The server where i'm deploying it has a wildcard domain like *.mydomain.it
After being started, Traefik does the initial configuration, but after a while throws an error 400 in the logs.

Here is the error (mydomain.it is my root domain):
time="2022-04-04T23:19:39Z" level=error msg="Unable to obtain ACME certificate for domains "portainer.mydomain.it": unable to generate a certificate for the domains [portainer.mydomain.it]: error: one or more domains had a problem:\n[portainer.mydomain.it] acme: error: 400 :: urn:ietf:params:acme:error:dns :: DNS problem: NXDOMAIN looking up A for portainer.mydomain.it - check that a DNS record exists for this domain; DNS problem: NXDOMAIN looking up AAAA for portainer.mydomain.it - check that a DNS record exists for this domain\n" providerName=le.acme ACME CA="###" routerName=frontend@docker rule="Host(portainer.mydomain.it)".

Can anyone help me with this error? I think its something really trivial but i'm stuck, and after 5 errors i need to wait an hour because i get an error 429 for too many failed attempts so its getting really long.
Thanks in advance!!

Hello @virtualGreg

Thanks for using Traefik and joining our community.

Would you please verify whether DNS records A and AAAA point to the valid Ip address?
The error message you shared is related to the invalid DNS entries.

In order to avoid reaching Lets Encrypt rate limits, it is good practice to use a staging server instead of production while the configuration is not yet ready.