Hi
I have a script setup which looks into dns cache and adds any address which relates to Netflix and puts it into the address list, I then have a routing mark which send the traffic down another route based on the address list and it works, however I do have an issue and need some help.
The script is:
/log info ("Starting Netflix script");
:foreach i in=[/ip dns cache all find where (name~"netflix")] do={
:local tmpAddress [/ip dns cache get $i name];
:if ( [/ip firewall address-list find where address=$tmpAddress] = "") do={
:local cacheName [/ip dns cache get $i name] ;
/log info ("added entry: $cacheName $tmpAddress");
/ip firewall address-list add address=$tmpAddress list=netflix-hosts;
}
}
/log info ("Ending Netflix script");
My issue is, the address list it creates are “dynamic” and it request DNS lookups every 3 seconds causing lots of DNS requests on my router, is there a command I can put into the script which changes the frequency/timeout?
I have this script duplicated for other websites which I need to send down other routes so my “dynamic” list is growing rapidly.
I’m using RouterOS 7.11.2
Thanks