Merge: + add "domains-only syntax" section

Squashed commit of the following:

commit 3786bb54577baa29c6acf4c9329c0e7e1ed19a19
Author: Simon Zolin <s.zolin@adguard.com>
Date:   Thu Feb 20 11:57:58 2020 +0300

    * edit "domains-only syntax" section

commit 2a8b0541d94e62a07d79343e12a87896d7a75238
Author: adworacz <adworacz@noemail>
Date:   Mon Feb 17 19:12:49 2020 +0300

    + add "domains-only syntax" section
Simon Zolin 2020-02-25 12:39:41 +03:00
parent 3251dd7d8c
commit b523688204
1 changed files with 17 additions and 1 deletions

@ -1,8 +1,9 @@
# AdGuard Home - How to write hosts blocklists # AdGuard Home - How to write hosts blocklists
There are two different approaches to writing hosts blocklists: There are three different approaches to writing hosts blocklists:
- [/etc/hosts syntax](#etc-hosts) - the old, tried and true approach is to use the same syntax as Operation Systems use for the "hosts" files. - [/etc/hosts syntax](#etc-hosts) - the old, tried and true approach is to use the same syntax as Operation Systems use for the "hosts" files.
- [domains-only syntax](#domains-only) - a list of domain names.
- [Adblock-style syntax](#adblock-style) - modern approach to writing filtering rules based on using a subset of the Adblock-style syntax. This way blocklists will be compatible with browser ad blockers. - [Adblock-style syntax](#adblock-style) - modern approach to writing filtering rules based on using a subset of the Adblock-style syntax. This way blocklists will be compatible with browser ad blockers.
If you are creating a blocklist for AdGuard Home, we recommend using the [Adblock-style syntax](#adblock-style). It has a couple of important advantages over the old-style syntax: If you are creating a blocklist for AdGuard Home, we recommend using the [Adblock-style syntax](#adblock-style). It has a couple of important advantages over the old-style syntax:
@ -49,6 +50,21 @@ Examples:
> Please note, that the `IP_address` value is ignored by most of the DNS filtering software. > Please note, that the `IP_address` value is ignored by most of the DNS filtering software.
## <a id="domains-only"></a> Domains-only syntax
This is just a list of domain names, one name per line.
Example:
```
example.com
example.org
```
If a string is not a valid domain (e.g. `*.example.org`), AdGuard Home will consider it to be an [adblock-style](#adblock-style) rule.
## <a id="adblock-style"></a> Adblock-style syntax ## <a id="adblock-style"></a> Adblock-style syntax
This is a subset of the [traditional Adblock-style](https://kb.adguard.com/en/general/how-to-create-your-own-ad-filters) syntax which is used by browser ad blockers. This is a subset of the [traditional Adblock-style](https://kb.adguard.com/en/general/how-to-create-your-own-ad-filters) syntax which is used by browser ad blockers.