I am using this address to capture Whatsapp IPs, but sometimes it captures 0.0.0.0 and add it to the list
do you have any solution?
Code: Select all
# Use DNS Entrys and add Address to the Firewall Address-list #
:foreach i in=[/ip dns cache all find where (name~"whatsapp") && (type="A") && (data!=0.0.0.0) ] 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=Whatsapp comment=$cacheName;
}
}