Hello everyone
I was wondering if there is a script for resolving and adding all the IPs of the websites which are on a link (example: https://test.com/sitelist.txt) to a address-list and add the host name as comment to the first IP of each website.
Example: Link/txt file is containing the following:
Open the file in an advanced text editor which allows advanced search and replace of one text block. google.com¶ yahoo.com¶ android.com¶ apple.com¶
search only “¶” / “return” / “new line” / “enter” / \n / \r\n, or what is that “button” called in your country,
and replace with
"; :execute “/ip firewall address-list add address=[:resolve $site] comment=$site list=scan”
:local site "
Fix first and last line.
You obtain the script:
:local site “google.com”; :execute “/ip firewall address-list add address=[:resolve $site] comment=$site list=scan”
:local site “yahoo.com”; :execute “/ip firewall address-list add address=[:resolve $site] comment=$site list=scan”
:local site “android.com”; :execute “/ip firewall address-list add address=[:resolve $site] comment=$site list=scan”
:local site “apple.com”; :execute “/ip firewall address-list add address=[:resolve $site] comment=$site list=scan”
Speaking of doing it with scripts in RouterOS, it’s just not worth it to me.