Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

PropertyDescription
address (IPv4/IPv6)The address that will be used for "A" or "AAAA" type records.
cname (string)Alias name for a domain name.
forward-toThe IP address of a domain name server to which a particular DNS request must be forwarded.
mx-exchange (string)The domain name of the MX server.
name (string)Domain name.
srv-port (integer; Default: 0)The TCP or UDP port on which the service is to be found.
srv-targetThe canonical hostname of the machine providing the service ends in a dot.
text (string)Textual information about the domain name.
type (A | AAAA | CNAME | FWD | MX | NS | NXDOMAIN | SRV | TXT ; Default: A)Type of the DNS record.
address-list (string)Name of the Firewall address list to which address must be dynamically added when some request matches the entry. Entry will be removed from the address list when TTL expires.
comment (string)Comment about the domain name record.

disabled (yes | no; Default: yes)

Whether the DNS record is active.

match-subdomain (yes | no; Default: no)

Whether the record will match requests for subdomains.

mx-preference (integer; Default: 0)

Preference of the particular MX record.

ns (string)

Name of the authoritative domain name server for the particular record.

regexp (POSIX regex)

Regular expression against which domain names should be verified.

srv-priority (integer; Default: 0)

Priority of the particular SRV record.

srv-weight (integer; Default: 0)

Weight of the particular SRV record.

ttl (time; Default: 24h)

Maximum time-to-live for cached records.

Info

For each static A and AAAA record, in cache automatically is added a PTR record.

Note

Regexp is case-sensitive, but DNS requests are not case sensitive, RouterOS converts DNS names to lowercase before matching any static entries. You should write regex only with lowercase letters. Regular expression matching is significantly slower than plain text entries, so it is advised to minimize the number of regular expression rules and optimize the expressions themselves.

...

Note

Before configuring, increase the DNS cache as it's used to store adlist entries. If limit is reached and error in DNS,error topic is printed "adlist read: max cache size reached"


PropertyDescription
urlUsed to specify the URL of an adlist.
ssl-verifySpecifies whether to validate the server's SSL certificate when connecting to an online resource. Will use the "/certificate" list in order to verify server validity.
fileUsed to specify a local file path from which to read adlist data
pause

Temporarily pause the use of all adlist.

Configuration examples:

URL based adlist:

Code Block
languageros
/ip/dns/adlist add url=https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts ssl-verify=no

To see how many domain names are present and matched, you can run:

Code Block
languageros
 ip dns adlist print
/ip/dns/adlist/print 
Flags: X - disabled 
0 url="https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts" ssl-verify=no match-count=122 name-count=164769 

Locally hosted adlist:

To create your adlist, you can create a Txt file with the domains. Example:

No Format
0.0.0.0 example1.com
0.0.0.0 eu1.example.com
0.0.0.0 ex.com
0.0.0.0 com.example.com

To add it :

Info

You can create the txt file on your PC, but it is also possible to create it in RouterOS, with following commands

"/file/add name=host.txt", and then you can run "file/edit host.txt contents" after adding entries, press "ctrl o" to save the entries.

To add file to adlist :

Code Block
languageros
/ip/dns/adlist/add
Code Block
languageros
ip dns adlist add file=hostTo verify that it's compiled correctly run print command and the results will show how many hostnames you have added (if the file is created correctly as provided in the example)  file=host.txt match-count=0 name-count=4
Info

You can verify that file is formatted correctly with "/ip/dns/adlist/print" ,the results will show how many hostnames you have added, the hostname format must match the format given in previous example.