Hello TarekH
You are in the right direction but to avoid network congestion or server load due to so frequent DNS update, you can use the parameter "-MaxNegativeTtl" to specify the maximum keeping time for records that have returned unsolvable.
"Specifies how long (1 to 2592000 seconds) an entry that records a negative answer to a query remains stored in the DNS cache. The value must be provided as a TimeSpan. The default setting is 15 minutes."
You can also add other fine tunning for your DNS server using the next reference: https://learn.microsoft.com/en-us/powershell/module/dnsserver/set-dnsservercache?view=windowsserver2022-ps
--If the reply is helpful, please Upvote and Accept as answer--