in version 6.36 added
What's new in 6.36 (2016-Jul-20 14:09):
*) firewall - allow to add domain name to address-lists (dynamic entries for resolved addresses will be added to specified list);
but MikrotikTeam, forgot to add this new feature return "on-error=", if there is already such an entry in the address-lists (so creates duplicates in address-lists).
It is only when adding URL.
try it yourself to run the script several times on version 6.36:
:do {/ip firewall address-list add address=google.com comment="google.com" timeout=0 list="BAN-list"} on-error={:put "failed add google.com, already exists."};
it work bad - creates duplicate entries in the address list.
Now try this script
:do {/ip firewall address-list add address=22.22.22.22 comment="Banned-X" list="list-X"} on-error={ :put "failed add 22.22.22.22"};
it works good, this script creates only one entry in the address-lists