Blog IT : smartphone and computer technology

www.domainesia.com

Rabu, 07 Agustus 2019

Setting Mikrotik : Auto Blokir Website Berdasarkan Keyword

Setting Mikrotik : Auto Blokir Website Berdasarkan Keyword




SYSTEM | SCRIPT | Add 

:foreach iDNS in=[/ip dns cache all find where (name~"poker" || name~"porn" || name~"indoxxi" || name~"bokep" || name~"indoxx1" || name~"duniafilm" || name~"filmsemi" || name~"xvideos") && (type="A") ] do={
# find and filtering keyword and only find record for type A
# for keyword just add keyword || name~"KEYWORD") before && (type="A")

:local tmpDNSsite [/ip dns cache get $iDNS name] ;
:local tmpDNSip [/ip dns cache get $iDNS address];
:local nameList "BLOCK_SITE";
# save to local cache by string

delay delay-time=10ms
# wait for 10ms

:if ( [/ip firewall address-list find where address=$tmpDNSip] = "") do={
# chek for no more duplicate site on cache

:log warning ("Added site to block on dns: $tmpDNSsite : $tmpDNSip");
# show info on warning log

/ip firewall address-list add address=$tmpDNSip list=$nameList comment=$tmpDNSsite;
# add site to add list entry.

}
}


EmoticonEmoticon