I want to make script to do auto add address of website to address list, then proxy will look to that address list and deny it.
Tired for me to re-add address of some sites, example: friendster.com (209.11.168.112, 209.11.168.113, 209.11.168.122, 209.11.168.123) and after some days or weeks the IP is changed or there is new IP.
1. How to make proxy support address-list?
2. How to detect all friendster.com sub-domain too for this script below? I mean, there is images.friendster.com that have different ip than friendster.com.
I already test the script below, but for the 2nd script (images.friendster.com doesn't work)
{
:foreach i in=[/ip dns cache find] do={
:if ([:find [/ip dns cache get $i name] "friendster.com"] > 0) do={
:log info ("friendster.com: " . [/ip dns cache get $i name] . " (ip address " . [/ip dns cache get $i address] . ")")
/ip firewall address-list add address=[/ip dns cache get $i address] list=list_Proxy_Friendster disabled=no comment="Friendster"
}
}
}
{
:foreach i in=[/ip dns cache find] do={
:if ([:find [/ip dns cache get $i name] "images.friendster.com"] > 0) do={
:log info ("images.friendster.com: " . [/ip dns cache get $i name] . " (ip address " . [/ip dns cache get $i address] . ")")
/ip firewall address-list add address=[/ip dns cache get $i address] list=list_Proxy_Friendster disabled=no comment="Friendster"
}
}
}
Yudi