Skip to content

Bundling hosts files and use it on RouterOS driven devices

Notifications You must be signed in to change notification settings

Zatvobor/adlist

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

adlist

This is a quite simple utility for managing NXDOMAIN static DNS records driven by RouterOS. You will be able to specify as many hosts files you have and get a sorted and uniq bundle as a .auto.rsc script.

The resulted bundle has a form:

:do {
    :local hosts {"example.com";"sub.+\\.example\\.com";};
    :foreach host in=$hosts do={
        :do {
            :if ($host ~ "\\.\\+") do={
                /ip/dns/static/add regexp=$host type=NXDOMAIN comment=example;
            } else={
                /ip/dns/static/add name=$host type=NXDOMAIN comment=example;
            };
        } on-error={ :nothing };
    };
};

I've added a submodule which contains a curated list of hosts, in case if you don't have any.

See mkadlist.sh before you hit it and change it for your needs.

About

Bundling hosts files and use it on RouterOS driven devices

Topics

Resources

Stars

Watchers

Forks

Languages