The Rules
The rules page shows the names that the server blocks or allows, whatever the blocklists say. It
also shows the patterns that match a name by its shape. These are the [[block]], [[allow]] and [[regex]]
entries of blocking.toml. Did a list block a name by mistake, or let a tracker through? Then use
this page to see your own rules first. To open the page, click “Rules” in the sidebar.
When you open the page, it reads blocking.toml. It does not read again by itself.
An operator and an admin can add, change and remove a blocked name, an allowed name and a
pattern. Change the names and Change the patterns say
how. They can also import a file of names or of patterns. A viewer reads the lists, and every role
can export the names as a file.
Import and export show only on a server that has their routes.
The header line
Section titled “The header line”Next to the title “Rules”, one line gives the counts of the three lists, for example “12 blocked names”, “3 allowed names” and “2 patterns”.
The tabs
Section titled “The tabs”The page has three tabs, one for each list:
- “Blocked names”: the names that the server blocks. A name also covers the names under it, so
ads.example.comblocksimg.ads.example.comtoo. - “Allowed names”: the names that the server never blocks. An allowed name wins over every block, from every list.
- “Patterns”: the patterns that match a name by its shape.
Each tab shows the count of its list. The address of the page holds the open tab, so a reload or a link opens the same tab. On a phone, the row of tabs scrolls sideways.
Find a name
Section titled “Find a name”Type in “Find a name” to show only the rows that hold the text, in any case. The text can be a part of a name, of a pattern, or of a note. If you open another tab, the filter stays. To show every row again, clear the field.
If the server refused a name or a pattern and the filter hides its row, the words of the server show above the list, with the file and the setting that they name. Clear the field to see the row with the words under it.
The rows
Section titled “The rows”The rows keep the order of blocking.toml.
- A blocked or allowed name shows the name. If the name has a note, the note shows next to it.
- A pattern shows the pattern, and under it a line that says what the pattern does, such as “Blocks A and AAAA for kids, as NXDOMAIN” or “Allows every type for every group”. Its note shows next to it.
The line of a pattern says:
- “Blocks” or “Allows”: what a match does.
- The query types that the pattern applies to, or “every type”.
- The groups of devices that the pattern applies to, or “every group”.
- “where the pattern does not match”: the pattern applies to every name that it does not match. An inverted block pattern blocks every other name.
- The answer of a block pattern: “the zero address”, “no data”, “NXDOMAIN”, or the addresses of the answer. “an address, with none set” means that the pattern asks for the address answer and names no address. If the line names no answer, the answer of the group applies.
A list can hold 10,000 names. The page draws only the rows near the view, so a long list scrolls without delay.
Change the names
Section titled “Change the names”A change stays in your browser until you save it. One save sends every list that changed.
- Open the tab “Blocked names” or “Allowed names”.
- To add a name, click “Add a blocked name” or “Add an allowed name”. A panel opens at the right side of the page, beside the list. On a phone, it rises from the bottom. Type the name in “Name”, and why you add it in “Note”. Then click “Done”.
- To change a name, click the button with three dots at the end of its row, then “Edit”.
- To remove a name, click the button with three dots, then “Remove”. The page asks “Remove ads.example.com?” first. Then the row stays, struck out, with “Undo”, until the save. A name that you added after the last save goes at once, with no row.
- Click “Review and save” in the bar at the bottom of the page. The review opens in a panel at the right side of the page. It lists each change, by list. Click “Save changes”. Click “Back” to close the panel: your changes stay on the page.
A changed row has a line at its left edge and a word: “new”, “changed” or “removed”. A tab with a change shows a pencil next to its count.
The panel refuses a name that its list holds already: “This list holds this name already.” It does not count a difference of upper and lower case, or a dot at the end. If the name is struck out in the list, click “Undo” on its row to keep it. Where the other list holds the name, the panel says which one wins. An allowed name wins over every block.
“Cancel” closes the panel. Escape, a click outside the panel, the close button at the top and a swipe close it too. If you changed the form, the panel does not close at once. “Cancel” turns red and says “Discard changes”, and a line beside it says “Click again to close without your changes.”. Click it again, or press Escape again, to close the panel and drop what you typed. To keep the form, click a field: the button says “Cancel” again. The pattern panel below works the same way.
The query log opens the same panel from the path of a query, with the name filled in (Allow or block the name). There, the panel saves the name at once.
Did you change your mind? Click “Discard” in the bar. The page asks first, then drops every change that you did not save.
When the server refuses the change
Section titled “When the server refuses the change”The review checks the change with the server as it opens. When the server refuses the change, its words show in red in the review.
- If the words are about one name, they show under the line of that name. Click “Back”. The page opens the tab of the name and shows its row, with the words under it. The tab shows a red mark.
- Any other refusal shows above the changes in the review, such as a name that the server cannot
read, or a list over the size that the server accepts. The file and the setting that the server
names show under it, under “File” and “Setting”, such as
blocking.tomlandblock. If such words come after “Save changes”, they also show above the tabs after you click “Back”.
Change what the words name, then click “Review and save” again.
When another change came first
Section titled “When another change came first”Somebody can change blocking.toml while you edit the page. Your save then gets the newer
revision, and your changes stay.
- If the other change did not touch a list that you changed, the review says “Another change came first”. Click “Save changes” again.
- If the other change touched a list that you changed, its tab shows a question mark. The tab says “Another change of blocking.toml came first, in revision 42.”. Click “Keep your list” to save your list over the other change. Click “Take the list of revision 42” to drop your changes of that list. Each tab with a question mark waits for its own choice before the save.
Change the patterns
Section titled “Change the patterns”A pattern goes into the same draft as the names, with the same review, save, refusals and choices after another change.
- Open the tab “Patterns”.
- To add a pattern, click “Add a pattern”. To change one, click the button with three dots at the end of its row, then “Edit”.
- Fill in the panel, then click “Done”:
- “Pattern”: a regular expression, a short text that describes the shape of a name. It matches
anywhere in the name, in lower case and with no dot at the end. A dot alone matches any
character, so write
\.for a dot. Soads\.matchesimg.ads.example.com, and^ads\.matches only a name whose first label isads, such asads.example.com. - “What a match does”: “Block” or “Allow”. An allow pattern wins over every block, the same as an allowed name.
- “Answer”, for a block only: “The answer of the group”, “The zero address”, “No data”, “NXDOMAIN”, or “The addresses below”. With the last one, give an “IPv4 address”, an “IPv6 address”, or both. For an allow pattern, the answer and the addresses stay in place but you cannot change them.
- “Match the names that the pattern does not match”: the pattern applies to every other name. An
inverted block blocks every name that the pattern does not match. For example, an inverted
block of
^school\.for the groupkidsblocks every name whose first label is notschool. - “Types”: the query types, one on each line, such as
AorAAAA. Leave it empty for every type. - “Groups”: a check box for each group of the Devices page. Leave all of them empty for every group.
- “Note”: why you add the pattern.
- “Pattern”: a regular expression, a short text that describes the shape of a name. It matches
anywhere in the name, in lower case and with no dot at the end. A dot alone matches any
character, so write
- To remove a pattern, click the button with three dots, then “Remove”. The page asks first. Then the row stays, struck out, with “Undo”, until the save.
- Click “Review and save”, then “Save changes”.
An allow pattern gives no answer, so “Allow” leaves the answer and the addresses out of the pattern. An answer other than “The addresses below” leaves the addresses out. The panel keeps what you typed, so a switch back loses nothing. When you save, the server checks the pattern and the types. If it refuses them, its words show as When the server refuses the change says.
A group that the pattern names stays in the list, checked, even where clients.toml no longer
holds it. The server refuses a save while a pattern names such a group. Check it off, or add the
group on the Devices page first. If the page cannot read the groups, the panel says “The groups did not load.”, with the
words of the server. It then shows only the groups that the pattern names.
Import from a file
Section titled “Import from a file”An import adds the names or the patterns of a file to one list, as a new revision. It does not wait for “Save changes”. Use it to bring in a list from another server, or an export of this page.
- Save or discard your changes first. While the page holds a change or saves it, the form says “An import saves at once. Save or discard your changes first.” or “This waits until the save ends.”, and “Review and save” is off. Just after a save, the form says “This waits until the page reads blocking.toml again.” for a moment, and “Import and save” is off until the read comes.
- Click “Import from a file” next to the title.
- In “Into”, pick “Blocked names”, “Allowed names” or “Patterns”. It starts at the open tab.
- Click the button of “File” and choose a text file of 4 MiB at most:
- A file of names holds one name on each line, such as
ads.example.com. A hosts line such as0.0.0.0 ads.example.comand a line such as*.example.comwork too. - A file of patterns holds one pattern on each line, with
;querytype=,;reply=and;invertwhere the rule needs them. - A blank line and a line that starts with
#are skipped. A file of names also skips a line that starts with!or[, such as[Adblock Plus 2.0].
- A file of names holds one name on each line, such as
- Click “Review and save”. The review says “Import blocked-names.txt into Blocked names”, with the file and its size, “Lines to read” and “Now in the list”. The server reads each line, so its answer says how many entries it added.
- Click “Import and save”.
One bad line refuses the whole file, and nothing is imported. The review then shows the words of the
server in red, with “Line” and its number. A pattern with ;reply=IP also names blocking.toml
when that file names no block_v4 or block_v6. Set one of them in blocking.toml first. Click “Back” to choose
another file. The words show under “File” too.
When the import lands, the panel closes, and the tab of the list opens. A message says, for example,
“12 names added. Already in the list: 3.”. For patterns with ;reply=IP, it adds “The patterns that
answer an address answer 192.0.2.1.”. A file whose entries the list holds already gives “The list
holds every entry of this file already. Nothing changed.”.
- If another change of
blocking.tomlcame first, the review says “Another change of blocking.toml came first. Import again to add the file over it.”. “Now in the list” shows the new count. Click “Import and save” again. - If the server did not answer, the review says “The server did not say whether the import landed. Read the lists again before you import again.”. Click “Read again”. A second click on “Import and save” sends the same import, so the server never adds the file twice.
Export the names
Section titled “Export the names”Click “Export” next to the title, then “Export blocked names” or “Export allowed names”. The browser
saves blocked-names.txt or allowed-names.txt, with one name on each line and each note as #
lines above its name. The server exports no patterns.
The file holds the lists that the server runs, not your changes. While the page holds a change, the menu says “The file holds the saved lists, not your changes.”. If the server refuses the export, a message says “The list did not download.”, with the words of the server.
When there is nothing to show
Section titled “When there is nothing to show”- “No blocked names yet.”, “No allowed names yet.” or “No patterns yet.”: the list of the tab is empty.
- “No entry holds ads.”: no row of the open tab holds the text of “Find a name”.
Errors
Section titled “Errors”When the page cannot read blocking.toml, it shows the error of the server in red, with “Try
again”. Click “Try again” to read the file again.
- The console cannot reach the server: check that the server runs and that your network works.
- Your session ended: the console opens the login page. Log in again.