Resolving subdomains for firewall rules

Hello,

I need to create a firewall rule for my on-prem servers to allow access to Azure Arc. Currently, my router’s firewall rules block all outbound server communication except for those listed on a whitelist. The issue arises with Microsoft’s use of subdomains, like *.his.arc.azure.com, which I’m unsure how to handle in RouterOS. I tried using a DNS caching script from the discussion below, but it didn’t work for Azure-specific addresses. Simply adding name into address list doesn’t work either. Do you have any suggestions on how to manage this?

Link to the script:
http://forum.mikrotik.com/t/whitelisting-whole-domain/137847/1