hi all
i am using this script to collect YouTube & Facebook IP addresses in DNS cache ( for block or separate route )
but it is not working and get result "input does not match any value of value-name"
please help me to solve issue
i print dns cash to find Facebook and YouTube in cach and get result below but when i run script get "input does not match any value of value-name" :
[admin@MikroTik] /ip dns cache> print
Flags: S - static
# NAME TYPE DATA TTL
4 S www.youtube.com A 216.239.38.120 1d
10 www.facebook.com CNAME star.c10r.facebook.com 44m31s
11 graph.facebook.com CNAME api.facebook.com 44m31s
# Script :
:foreach i in=[/ip dns cache all find where (name~"facebook" || name~"youtube") && (type="A") ] do={
:local tmpAddress [/ip dns cache get $i address];
delay delay-time=10ms
#prevent script from using all cpu time
: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=restricted comment=$cacheName;
}}