Is it possible to know/resolve multiple DNS names to IP “wildcard like”?

Is it possible to know/resolve multiple DNS names to IP “wildcard like”? For example:

*.telemetry.microsoft.com

Maybe it is a two step process, first get the DNS names are matching, then resolve them one by one, that is completely fine. The point is to automate the whole process.

(I would like to automate adding Windows firewall rules, so first I need to resolve them to their respecive IPv4 and IPv6)