1. Перехватывать все DNS-запросы: /ip firewall nat add action=redirect chain=dstnat comment=DNS dst-port=53 protocol=tcp to-ports=53 add action=redirect chain=dstnat dst-port=53 protocol=udp to-ports=53 /ip firewall filter add chain=forward dst-address-list=restricted action=drop 2. Написать скрипт и запланировать его запуск, скажем, каждые 30 секунд: foreach i in=[/ip dns cache find] do={ :local bNew “true”; :local NameAddress [/ip dns cache all get $i name] ; :put $NameAddress; :if (([:find $NameAddress “freedownload”] != 0)) do={ :local tempAddress [/ip dns cache get $i address] ; :put $tempAddress; если список адресов пуст, не проверять :if ( [/ip firewall address-list find ] = “”) do={ :log info (“added entry: $[/ip dns cache get $i name] IP $tempAddress”); /ip firewall address-list add address=$tempAddress list=restricted comment=$NameAddress; } else={ :foreach j in=[/ip firewall address-list find ] do={ :if ( [/ip firewall address-list get $j address] = $tempAddress ) do={ :set bNew “false”; } } :if ( $bNew = “true” ) do={ :log info (“added entry: $[/ip dns cache get $i name] IP $tempAddress”); /ip firewall address-list add address=$tempAddress list=restricted comment=$NameAddress; } } }
