Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- :do {
- :local LIST "browsec";
- :local DOMAIN "tcdn.me";
- :foreach Crec in=[/ip dns cache all find where ( ( (type="A") || (type="CNAME") ) && (static=no) && (name~$DOMAIN) )] do={
- :local Cname [/ip dns cache get number=$Crec name];
- :local Cdata "";
- :delay 1000ms;
- :if ([/ip dns cache all get $Crec type]="CNAME") do={
- :set $Cdata [:resolve $Cname]; } else={
- :set $Cdata [/ip dns cache get number=$Crec address]; }
- :do {/ip firewall address-list
- :do {
- add list=$LIST address=$Cdata comment=$Cname disabled=no
- } on-error={
- :log warning message="address entry exist: List=$LIST , Host=$Cname , Address=$Cdata";}
- }
- }
- } on-error={:log error message="script failed..."}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement