Para que este script funcione debe ejecutarlo según el nombre de la pagina que vas querer
copia este script al blog notas de windows luego que lo tenga alli en tu teclado preciona "Ctrl + R" eso te facilitara editar tu script de forma mas eficiente
capturar ejemplo facebook
/system script add name= facebook policy=read,write,policy source="# chequear las entradas al \
DNS\r\
\n:foreach i in=[/ip dns cache find] do={\r\
\n:local bNew \"true\";\r\
\n:local cacheName [/ip dns cache all get \$i name] ;\r\
\n# Revisar el DNS si contiene cadenas facebook\r\
\n:if ([:find [/ip dns cache get \$i name] \" facebook\"] > 0) do={\r\
\n:local tmpAddress [/ip dns cache get \$i address] ;\r\
\n#---- Si address list esta vacio, no lo chequeo ( add address directly )\
\r\
\n:if ( [/ip firewall address-list find ] = \"\") do={\r\
\n/ip firewall address-list add address=\$tmpAddress list= facebook_dns_ips\
\_disabled=no comment=\$cacheName; \r\
\n} else={\r\
\n#------- chequeo cada entrada del address-list para no repetir las ips\r\
\n:foreach j in=[/ip firewall address-list find ] do={\r\
\n#---------- set bNew variable to false if address exists in address list\
\r\
\n:if ( [/ip firewall address-list get \$j address] = \$tmpAddress ) do={\
\r\
\n:set bNew \"false\";\r\
\n}\r\
\n}\r\
\n#------- Si la direccion (IP) es nueva, la agrego al ADDRESS-LIST\r\
\n:if ( \$bNew = \"true\" ) do={\r\
\n/ip firewall address-list add address=\$tmpAddress list= facebook_dns_ips\
\_disabled=no comment=\$cacheName; \r\
\n}\r\
\n}\r\
\n}\r\
\n}"
/system scheduler
add interval=1m name=facebook_dns_ip on-event=facebook policy=\
ftp,reboot,read,write,policy,test,password,sniff,sensitive start-time=\
startup
Acá te dejo el script Base
/system script add name=Nombre_DNS_Para_caturar policy=read,write,policy source="# chequear las entradas al \
DNS\r\
\n:foreach i in=[/ip dns cache find] do={\r\
\n:local bNew \"true\";\r\
\n:local cacheName [/ip dns cache all get \$i name] ;\r\
\n# Revisar el DNS si contiene cadenas Nombre_DNS_Para_caturar\r\
\n:if ([:find [/ip dns cache get \$i name] \"Nombre_DNS_Para_caturar\"] > 0) do={\r\
\n:local tmpAddress [/ip dns cache get \$i address] ;\r\
\n#---- Si address list esta vacio, no lo chequeo ( add address directly )\
\r\
\n:if ( [/ip firewall address-list find ] = \"\") do={\r\
\n/ip firewall address-list add address=\$tmpAddress list=Nombre_DNS_Para_caturar_dns_ips\
\_disabled=no comment=\$cacheName; \r\
\n} else={\r\
\n#------- chequeo cada entrada del address-list para no repetir las ips\r\
\n:foreach j in=[/ip firewall address-list find ] do={\r\
\n#---------- set bNew variable to false if address exists in address list\
\r\
\n:if ( [/ip firewall address-list get \$j address] = \$tmpAddress ) do={\
\r\
\n:set bNew \"false\";\r\
\n}\r\
\n}\r\
\n#------- Si la direccion (IP) es nueva, la agrego al ADDRESS-LIST\r\
\n:if ( \$bNew = \"true\" ) do={\r\
\n/ip firewall address-list add address=\$tmpAddress list=Nombre_DNS_Para_caturar_dns_ips\
\_disabled=no comment=\$cacheName; \r\
\n}\r\
\n}\r\
\n}\r\
\n}"