Community discussions

MikroTik App
 
yudigadget
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 60
Joined: Fri Mar 23, 2007 1:09 pm

Why doesn't work: script dns cache - address list?

Sat Sep 20, 2008 9:37 am

{
:foreach k in=[/ip dns cache find] do={
:if ([:find [/ip dns cache get $k name] "res.sriwijaya-air-online.com"] > 0) do={
:log info ("sriwijaya: " . [/ip dns cache get $k name] . " (ip address " . [/ip dns cache get $k address] . ")")
/ip firewall address-list add address=[/ip dns cache get $k address] list=list_ticketing disabled=no comment="res.sriwijaya-air-online.com"
}
}
}

what that script doesn't work.. but if i change it with google.com, klikbca.com then it works.. :( why?
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 7199
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: Why doesn't work: script dns cache - address list?

Mon Sep 22, 2008 9:34 am

Maybe "res.sriwijaya-air-online.com" is not showing up in "/ip dns cache". Try "/ip dns cache all" it will show all entries including CNAME and NS