:foreach i in=[/ip dns cache find] do={
:local bNew “true”;
:local cacheName [/ip dns cache all get $i name] ;
# :put $cacheName;
:if (([:find $cacheName “facebook”] != 0) || ([:find $cacheName “akamai”] != 0)) do={
:local tmpAddress [/ip dns cache get $i address] ;
# :put $tmpAddress;
# if address list is empty do not check
:if ( [/ip firewall address-list find ] = “”) do={
:log info (”added entry: $[/ip dns cache get $i name] IP $tmpAddress”);
/ip firewall address-list add address=$tmpAddress list=nice comment=$cacheName;
} else={
:foreach j in=[/ip firewall address-list find ] do={
:if ( [/ip firewall address-list get $j address] = $tmpAddress ) do={
:set bNew “false”;
}
}
:if ( $bNew = “true” ) do={
:log info (”added entry: $[/ip dns cache get $i name] IP $tmpAddress”);
/ip firewall address-list add address=$tmpAddress list=nice comment=$cacheName;
}
}
}
}
semoga bermanfaat
sumber:http://anak1lang.co.cc/?p=55
:local bNew “true”;
:local cacheName [/ip dns cache all get $i name] ;
# :put $cacheName;
:if (([:find $cacheName “facebook”] != 0) || ([:find $cacheName “akamai”] != 0)) do={
:local tmpAddress [/ip dns cache get $i address] ;
# :put $tmpAddress;
# if address list is empty do not check
:if ( [/ip firewall address-list find ] = “”) do={
:log info (”added entry: $[/ip dns cache get $i name] IP $tmpAddress”);
/ip firewall address-list add address=$tmpAddress list=nice comment=$cacheName;
} else={
:foreach j in=[/ip firewall address-list find ] do={
:if ( [/ip firewall address-list get $j address] = $tmpAddress ) do={
:set bNew “false”;
}
}
:if ( $bNew = “true” ) do={
:log info (”added entry: $[/ip dns cache get $i name] IP $tmpAddress”);
/ip firewall address-list add address=$tmpAddress list=nice comment=$cacheName;
}
}
}
}
semoga bermanfaat
sumber:http://anak1lang.co.cc/?p=55
Makasih untuk sharenya...
ReplyDeleteSaya dah coba, trus hasilnya lihat dimana ya?
Sori nubi banget :D