{ :do { :local debug 0; :local addressList "###ADDRESS_LIST###"; ##INSERT_LINES :foreach dom in=$staticDomains do={ :do { /ip/firewall/address-list/add address=$dom list=$addressList; } on-error={ if ($debug > 0) do={ :log info "error adding "; } } } :foreach rec in=[/ip/dns/cache/print as-value ] do={ :foreach regexTestString in=$regexString do={ if ( ($rec->"type")~"(CNAME|A)\$" ) do={ if ( ($rec->"name")~"$regexTestString" ) do={ :do { /ip/firewall/address-list/add address=($rec->"name") list=$addressList; } on-error={ if ($debug > 0) do={ :log info "error adding "; } } } } } } } on-error={ :log info "RUNTIME Error"; } }