DNS script

Hi,

Please help me to run this script under V.3.4 it’s for copy address from DNS cache to static DNS:

:foreach a in=[/ip dns cache find static=no] do={
  /ip dns static add address=[/ip dns cache get $a address] name=[/ip dns cache get $a name]
}

Regards

are you trying to break things ? dns cache isn’t supposed to be statically entered and will cause major problems if it is. if you enter our IP addresses into your dns server as authoritative I will hunt you down and shake a stick at you : )

changeip,
I need script copy all the sites from the dns cache and adds it to dns static, I see it successful in http://forum.mikrotik.com/t/dns-script/12088/1 it seems to be in v2.9.X
now I try with v3.4 and nothing :frowning:

Any help

I can’t help you because it’s against my policy. : ) Point your DNS to a good resolver and let it run the way it’s supposed to.

what for? it will probably break the internet connection for your customers

After the copy I will filter the useful DNS addresses that is static for sites and not change periodically(like yahoo and Google),
I hope to make this similar to DNS server operation
So what the befits of static DNS option in MT ?

once you resolve google.com or yahoo.com they will be used just as a static address, however, they will be refreshed periodically. A static entry is used if they are your hostnames (or you want to disallow resolving certain names).

Thanks changeip
so any help to make copying script ?