My address lists are updated regularly by the standard script that resolve the hostname to an ip:
Code: Select all
:local comment
:local newip
:local oldip
# Loop through each entry in the address list.
:foreach i in=[/ip firewall address-list find] do={
# Get the first five characters of the list name
:set list [:pick [/ip firewall address-list get $i list] 0 5]
# If they're 'host_', then we've got a match - process it
:if ($list = "host_") do={
# Get the comment for this address list item (this is the host name to use)
:set comment [/ip firewall address-list get $i comment]
:set oldip [/ip firewall address-list get $i address]
# Resolve it and set the address list entry accordingly.
:do {:set newip [:resolve $comment];} on-error {set newip $oldip};
: if ($newip != $oldip) do={ /ip firewall address-list set $i address=$newip }
}
}
This happens only for two hostnames that are present in multiple address lists. It is resolved properly for the few first instances but then not anymore on the following.
That is leading me to the following questions:
- is the resolve command sending the request to the outside dns everytime or is it using the mikrotik dns cache for the next ones if the ttl delay is not expired?
- would some dns server refuse to reply after being queried too many time for the same host within a short time frame?
Thanks