Site Tools


advanced-adblock

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
advanced-adblock [2023/08/05 17:20] – [Domain Blacklist URLs & Group-of-Lists] hogwildadvanced-adblock [2025/02/23 01:27] (current) – [Domain blacklist custom] -spelling, condense hogwild
Line 1: Line 1:
-====== Adblock ======+====== Adblock (DNS filtering) ======
  
-This menu contains settings to configure FreshTomato's ad blocker. It is strongly advised that you read the **How Adblock Works** section to understand its functioning, even if you use v2.+This menu contains settings to configure FreshTomato's ad blocker-DNS filteringThis feature can block ads, some malware, crypto miners, privacy-invading scripts and more, depending on the lists you use. 
 + 
 +You are strongly advised to read the How Adblock Works section to understand its functioning
 + 
 +In documentationthe function/menu will be spelled capitalized ("Adblock"). The actual script will be spelled "adblock", in lower case\\
  
-In this documentation, the function/menu will be spelled capitalized ("Adblock"). The script that executes will be spelled in lower case ("adblock"). \\ 
  
 ===== v1 and v2 ===== ===== v1 and v2 =====
Line 9: Line 12:
 There are currently two versions of Adblock: [[advanced-adblock#adblock_v1|adblock_v1]] and [[advanced-adblock#adblock_v2|adblock_v2]]. There are currently two versions of Adblock: [[advanced-adblock#adblock_v1|adblock_v1]] and [[advanced-adblock#adblock_v2|adblock_v2]].
  
-\\ This table lists the Adblock versions available on different types of hardware\\+\\ This table lists the Adblock versions available on different types of hardware\\   \\
  
-^ Hardware ^ FT < 2023.1 ^ FT >= 2023.1 ^+^ Hardware ^ Releases < 2023.1 ^ Releases >= 2023.1 ^
 | MIPS R1 | [[advanced-adblock#adblock_v1|v1]] | [[advanced-adblock#adblock_v1|v1]] | | MIPS R1 | [[advanced-adblock#adblock_v1|v1]] | [[advanced-adblock#adblock_v1|v1]] |
 | MIPS R2 | [[advanced-adblock#adblock_v1|v1]] | [[advanced-adblock#adblock_v2|v2]] | | MIPS R2 | [[advanced-adblock#adblock_v1|v1]] | [[advanced-adblock#adblock_v2|v2]] |
 | ARM | [[advanced-adblock#adblock_v1|v1]] | [[advanced-adblock#adblock_v2|v2]] | | ARM | [[advanced-adblock#adblock_v1|v1]] | [[advanced-adblock#adblock_v2|v2]] |
  
- \\ Adblock v1 functionality is a reduced version of ad-blocking scripts taken from code outside FreshTomato. Enabling one of those scripts and FreshTomato Adblock at the same time may cause conflicts. Do not enable both.+ \\ Adblock v1 functionality is taken from ad-blocking scripts outside FreshTomato. **Do not enable one of those scripts and FreshTomato Adblock at the same time**. Doing so may cause conflicts.
  
 Adblock v2 uses advanced methods to block ads. It should be the preferred choice whenever possible. Adblock v2 uses advanced methods to block ads. It should be the preferred choice whenever possible.
Line 23: Line 26:
 ===== How Adblock Works ===== ===== How Adblock Works =====
  
-FreshTomato'Adblock works through DNS cache poisoning, as follows:+Adblock works through DNS cache poisoning, as follows: 
 + 
 + \\ 
 + 
 +  - A client makes a DNS request to resolve a (sub)domain. \\  \\  
 +  - Dnsmasq searches both its positive lookup cache and its negative \\ lookup cache for a match of the requested (sub)domain. (( 
 +You can adjust settings for both caches in the //dnsmasq custom configuration// field in the [[advanced-dhcpdns|DHCP/DNS/TFTP]] menu. 
 +)) \\ If it finds an entry, the script proceeds to step 5. If not, it proceeds\\ to step 3.\\  \\  
 +  - Dnsmasq searches its configuration files for a corresponding \\ entry. \\ \\ For adblock, the "dnsmasq.adblock" file holds the (sub)domains \\ to block. If an entry is found, it processes the entry. In the case \\ of adblock, the action is: resolve the domain to "0.0.0.0" or \\ "NXDOMAIN" (non-existent domain). Dnsmasq then proceeds \\ to step 5. \\  \\  
 +  - Dnsmasq queries an upstream DNS server for the (sub)domain, directly \\ or via stubby/dnscrypt. The result is a positive lookup, or an \\ "NXDOMAIN". \\  \\  
 +  - The result from these steps is sent to the cache and returned \\ to the requesting client. 
 + 
 + \\ 
 + 
 +Given a source list, the original script just blocks ads. However, there are other reasons for your network to avoid communication with certain servers. Thus, the function was renamed "Adblock-DNS Filtering" to reflect increased abilities.
  
-  * dnsmasq resolves the domain's correct IP address. 
-  * The adblock script then replaces that address with an address of 0.0.0.0 . 
-  * The 0.0.0.0 address is sent to the client requesting DNS resolution. 
-  * Since 0.0.0.0. is an NXDOMAIN (invalid/unknown address), no connection is made to that URL. 
  
-Given a list of sources, the original script simply blocks ads. However, there are other reasons for your network to avoid communicating with certain servers. This function was therefore renamed "DNS Filtering" to reflect its progression towards a wider function. 
 ===== Adblock Settings ===== ===== Adblock Settings =====
  
  \\ **Enable**: Checking this box turns on Adblock.  \\ **Enable**: Checking this box turns on Adblock.
  
-The adblock script downloads lists of URLs/domains to block, mostly from the Blacklist URL & Group-of-lists table. You can select or deselect any list in this table to be included in the downloads (the "blocklist").+The adblock script downloads URL/domain lists to block, mostly from the Blacklist URL & Group-of-lists table. You can select/deselect any list in this table include in the downloads (the "blocklist").
  
  \\  \\
  
-**Debug mode (v1)**+**Debug mode (v1 only)**
  
-Checking this box enables debug mode for dnsmasq in the log. This tells FreshTomato that you want all DNS queries routed to dnsmasq to be logged to the system log (syslog). This is useful when testing/troubleshooting Adblock. For more on testing, see the //Notes and Troubleshooting// section of this page. This option is identical to "Debug Mode" in the [[advanced-dhcpdns|DHCP/DNS/TFTP]] menu. Thus, in v2, it was removed from the Adblock menu.+This enables debug mode for dnsmasq in the log. It tells FreshTomato to log all DNS queries routed to dnsmasq to the system log.
  
- \\+This is useful when testing/troubleshooting Adblock. Since this option was identical to "Debug Mode" in the [[advanced-dhcpdns|DHCP/DNS/TFTP]] menu, it was removed from the Adblock menu in v2.
  
-{{::adblock-v2-settings.jpg?580x199}}+For more on testing, see the Notes and Troubleshooting section of this page.
  
- \\+ \\ {{::adblock_enable.png?400}} 
 + 
 +\\
  
 **Max Log Level (v2)**: **Max Log Level (v2)**:
  
-Thew new v2 interface lets you set the maximum log level output the script will generate.   \\  \\+The newer v2 interface lets you set the maximum log level output the script will generate.   \\  \\ Options include:
  
-Supported levels include:+ \\
  
   * 0:  The script will log only basic messages like start and stop.   * 0:  The script will log only basic messages like start and stop.
-  * 3   (Error) is the default value. Once you are confident with your setup, this setting is sufficient.+  * 3   (Error). Once you're confident with your setup, this option is sufficient. (Default).
   * 4   * 4
   * 5   * 5
   * 6   * 6
-  * 7  (Debug level) writes very detailed log information. This is helpful when troubleshooting common problems.+  * 7  (Debug level) writes very detailed log information, useful for troubleshooting.
  
-The higher the setting, the more detailed will be the information recorded in the logs.+ \\ 
 + 
 +The higher the number, the more detailed the information the logs will record.
  
  \\  \\
Line 70: Line 86:
  \\  \\
  
-A good way to view the logs is to go to the [[status-log|Logs]] menu and enter 'adblock' in the "Find in syslog" field. This filters the log view to show only entries adblock entries. At level 7, adblock produces additional debugging files. These files are saved in /tmp/adblock.debug.$now, (where "$now" is the absolute number of seconds elapsed). References to adblock in the the trace file will then be displayed in the Web interface.\\  \\+ \\
  
- {{::20230125-163305.png?776x296|Viewing adblock log entries}}\\  \\+A good way to view Adblock log entries is to go to the [[status-log|Logs]] menu and type: "adblock" in the "Find in syslog" field. This filters the view to show only adblock entries. 
 + 
 +When set to level 7, adblock writes additional debug files in: "/tmp/adblock.debug.$now, 
 + 
 +(where "$now" is the absolute number of seconds passed). Adblock references in the the trace file are then displayed in the web interface.\\  \\ 
 + 
 +{{::20230125-163305.png?776x296|Viewing adblock log entries}}\\  \\ 
 + 
 + \\
  
 **Blockfile size limit (v2 only)**: **Blockfile size limit (v2 only)**:
  
-Adblock v1 may crash FreshTomato if it loads lists whose combined information exceeds your router's resource capacity. This can be difficult to assess and troubleshoot. Adblock v2 comes with a customizable "//limit//" field. If the limit field is left empty, FreshTomato will calculate its value automatically. It will also calculate the value automatically if the router was reset to defaults.+V1 may crash FreshTomato if it loads lists whose combined information exceeds the router's resource capacity. This can be hard to troubleshoot. Adblock v2 comes with a customizable "//limit//" field. If left empty, FreshTomato will calculate its value automatically. It will also calculate the value automatically if the router was reset to defaults.
  
  \\  \\
Line 84: Line 108:
  \\  \\
  
-This limit is calculated as 10% of physical RAM (when external storage is set). When no external storage is found, the limit is calculated as 6.5% of RAM. The limit can be also manually configured. However, if your device becomes unstable, it is advised that you revert to the automatically-calculated value.+When using external storage, the limit is calculated as 10% of physical RAM. When no external storage is found, the limit is calculated as 6.5% of RAM. The limit can be manually configured too. However, if the device becomes unstable, please revert to the auto-calculated value.
  
-To be clear, this is a limit, not a target. There'nothing wrong with having small blockfile compared to the limit. A larger blockfile will result in longer restart times for the dnsmasq service. This is important because there will be no DHCP/DNS/TFTP functionality until dnsmasq finishes restarting.+This is a limit, not a target. It'fine to have smaller blockfile than the limit. A larger blockfile will result in longer restart times for the dnsmasq service. That'important because DHCP/DNS/TFTP won't function until dnsmasq finishes restarting.
  
  \\  \\
Line 92: Line 116:
 **Custom Path (v2):** **Custom Path (v2):**
  
-An important v2 feature is the ability to configure an (optional) path to permanent storage where adblock can store relevant files. You are strongly advised to specify a custom pathA custom path enables extra functionality in the script. It allows adblock to store whole lists, their http headers and the actual compiled blockfile on external storage. This offloads RAM demand (/tmp) to permanent storage, and allows for information to survive a reboot. +An important v2 option is the ability to configure path to permanent storage. There, Adblock can store relevant files. Doing this is strongly encouragedIt allows extra script functionality. It allows Adblock to store whole lists, their http headersand the compiled blockfile there. This offloads RAM demand (/tmp) to permanent storage, and lets information survive a reboot. It also makes troubleshooting easier.
- +
- \\ {{adblock-v2-custom_path.jpg?573x31}}+
  
  \\  \\
  
-This is very useful when the script is re-run (manually or automatically) and there are no updated lists or configuration changes. The check for configuration changes involves controlling any modification to nvram variables since the last script run.+{{::advanced-adblock-custom_path-v2.png?492}} \\  \\
  
-When a custom path is defined, adblock will:+It is also helpful when the script is rerun (manually or not) and there are no updated lists or configuration changes. The check for configuration changes involves controlling any modification to NVRAM variables since the last script run.
  
-  - Download all http headers from only the enabled lists +When a custom path is defined, Adblock will: 
-  - Compare those headers with the ones stored locally+ 
 + \\ 
 + 
 +  - Download all http headers from only the enabled lists. 
 +  - Compare those headers with the ones stored locally.
   - Decide whether to re-process the blocklists or not.   - Decide whether to re-process the blocklists or not.
 +
 + \\
  
 This runs as follows: This runs as follows:
  
-  * If the configuration wasn't changed and;  + \\ 
-  * No updated lists are available+ 
 +  * If the configuration did not change and;  
 +  * No updated lists are available;
   * Skip the re-processing and return to idle.   * Skip the re-processing and return to idle.
 +
 + \\
  
 This saves time and resources. This saves time and resources.
  
-Hereconfiguration means any externally-mapped files where //blacklist_custom// or whitelists are defined (For example: /mnt/USB/my_whitelist.txt). Using a Custom path also allows adblock to load faster on post-(re)boot.+"Configuration"in this case, is any externally-mapped files where //blacklist_custom// or whitelists are defined
 + 
 +For example: "/mnt/USB/my_whitelist.txt". 
 + 
 +Using a Custom path also allows adblock to load faster post-boot.
  
  \\  \\
Line 121: Line 157:
 ==== Domain Blacklist URLs & Group-of-Lists ==== ==== Domain Blacklist URLs & Group-of-Lists ====
  
-This table contains a list of the blacklists FreshTomato can download and use to block ads.+This table contains a list of blacklists which can be downloaded and used to block ads.
  
-**On:**  Checking this box will make a gold star appear. The star confirms Adblock will enable downloading of the blacklist in that row. After selecting which blacklists you wish to use, click **Save**.+**On:**  Checking this makes Adblock enable downloading of the blacklist in that row.
  
-**Blacklist URL:**  This shows the location on the Internet where that blacklist can be found.+Upon checking it, a gold star appears to confirm your choice. After selecting the blacklists to use, click **Save**.
  
-**NOTE:** Since release 2023.4 by defaultno blocklists were defined as part of the standard releases. This was done to to reduce NVRAM demand. However, you can add your preferred lists manually. A good summary of these lists is the official [[adblock_dns_filtering|Adblock (DNS filtering) lists]] page on this Wiki.+ \\ 
 + 
 +**Blacklist URL:**  shows the Internet location where that blacklist can be found. 
 + 
 +Since release 2023.4, the defaults don't include blockliststo reduce NVRAM demand. You can add them manually. They are summarized on the official [[adblock_dns_filtering|Adblock (DNS filtering) lists]] page.
  
  \\  \\
  
-{{::adblock-v2-domain_blocklist_urls_and_list-of-lists.jpg?802x363}}+{{::advanced-adblock-domain_blacklist_urls.png?915}}
  
  \\  \\
  
-**Description:**  Displays a name (if the publisher used one) or reference for the blacklist in that row.+**Description:**  displays a name (if the publisher used one) or reference for the blacklist in that row.
  
-**Delete:**  If you move your mouse over a row containing a blacklist, a red "x" appears at the end of the row. Clicking "x" will delete that row, permanently deleting that blacklist.+ \\
  
-There is no option to reset these to the original Blacklist URL entries.+**Delete:** if you move your mouse over a row with a blacklist, a red "x" shows at the end of the row. Clicking "x" deletes the row, and permanently deletes the blacklist.
  
-If you delete a URL that'important to you, you will need to:+There'no option to reset these to the original Blacklist URL entries. 
 + 
 +If you delete an important URL, you will need to:
  
   * Re-enter it into the Blacklist URL table or;   * Re-enter it into the Blacklist URL table or;
   * Reset FreshTomato to default settings   * Reset FreshTomato to default settings
  
-**Add:**  Clicking this inserts a blank row. In this row, you can type a new URL from which to download and use an additional Blacklist URL.+ \\
  
-You can also add a comment in the Description field.+However, the wiki contains a list of default blacklists: [[https://wiki.freshtomato.org/doku.php/adblock_dns_filtering|Adblock (DNS filtering) lists]] for your reference. 
 + 
 + \\ 
 + 
 +**Add:** inserts a blank row. There, you can type a new URL from which to download and use an additional Blacklist URL. 
 + 
 +You can add a comment in the Description field.
  
  \\  \\
Line 155: Line 203:
 ==== Compatible data formats ==== ==== Compatible data formats ====
  
-Target lists to be downloaded must be in plain text formatAs above, v2 can extract domains from lists in a variety of formats. Essentially, adblock uses a regex against each line of the file. Lines from the source file are parsed, comments are removed and then the domains are extracted. This is true regardless of where (in which column) those domains are in the list.+Lists to download must be in plain text. V2 can extract domains from lists in several formats. Essentially, it uses a regex against each line in the file. 
 + 
 + \\ 
 + 
 +  - Lines from the source file are parsed
 +  - Comments are removed
 +  - The domains are extracted. 
 + 
 + \\ 
 + 
 +This is true regardless of where (in which column) those domains are in the list. 
 + 
 + \\
  
 **Group-of-lists** **Group-of-lists**
  
-Currently, v2 also accepts a new list format called "Group-of-lists". This involves feeding the script a URL which contains links to a list of further URLs. The Group-of-lists is an excellent way to save NVRAM space.+V2 also accepts a new list format called "Group-of-lists". This involves feeding the script a URL of links to a list of further URLs. The Group-of-lists is great at saving NVRAM space.
  
  \\  \\
Line 169: Line 229:
 </code> </code>
  
- \\   or  \\+ \\   or \\
  
 <code -> <code ->
Line 178: Line 238:
 </code> </code>
  
- \\  \\ The Group-of-lists format has limitations. One limitation is that it doesn'perform verification of the lists to assess whether they need to be downloaded or not.+ \\  \\ A limitation of the Group-of-lists format is that it doesn'check the lists to assess whether they need downloading or not.
  
-Adblock automatically handles EOL (End of Line) characters in files, when necessary. It converts them internally.+When needed, adblock automatically handles EOL (End of Line) characters in files by converting them internally.
  
-Group-of-lists are visible in the log file. For example, they might appear as "[8][2]"  The text in this example would mean that adblock is processing the 8th defined list in the Domain blacklist URLs & Group-of-lists on the second line (URL).  \\   \\+ \\ 
 + 
 +Group-of-lists are visible in the log. 
 + 
 +For example, if you see: "[8][2]"  it would mean
 + 
 +adblock is processing the 8th defined list in the Domain blacklist URLs & Group-of-lists on the second line (URL).  \\   \\
  
  
 ==== Domain blacklist custom ==== ==== Domain blacklist custom ====
  
-{{:pasted:20230425-145638.png?775x165}}+{{:pasted:20230425-145638.png?831}}
  
  \\  \\
Line 193: Line 259:
 === Domain Syntax === === Domain Syntax ===
  
-Several syntaxes are valid for this list:+The syntax for this list is as follows:
  
-  * Standard domains (one entry per line) + \\
-  * A path to a local file where domains are defined. The file should contain one domain per line. \\ For example: "/mnt/usb/my_blacklist.txt"+
-  * A domain prefixed with a "+" sign will blacklist that domain and force a pruning of any subdomains found in the final blockfile.+
  
-When adding custom entries:+  - Standard domains (one entry per line). 
 +  - A "#" or "!" preceding text marks the line as comment only- \\ to be ignored by script. 
 +  - A domain prefixed with "+" blacklists the domain \\ and prunes subdomains \\ found in the final blockfile.
  
-If you blacklist: "sub.domain.com", then+ \\ \\ This table summarizes the Domain blacklist syntax:
  
-"sub1.sub.domain.com"+ \\
  
-"sub2.sub.domain.com"+^ Adding custom entry ^ Will blacklist / Do the following ^ 
 +| sub.domain.com | sub.domain.com \\ "sub2.sub.domain.com" \\ and all subdomains of "sub.domain.com"
 +| +sub.domain.com  | sub.domain.com \\ \\ Will also prune blockfile of dupes/redundant entries.\\ This reduces RAM usage, CPU cycles and storage space  | 
 +| # or !  | Any string defined before them is considered but the rest of the line is ignored.  |
  
-and all other subdomains will be blacklisted.+ \\ You can also specify a path to a domain file (one domain per line).
  
-However, this may not be what you want.+For example: "/mnt/usb/blacklist.txt".
  
-To prevent subdomains of an entry from being filteredprepend "%" sign to an entry.+Using external storage is convenient and offers some advantages for maintaining your blocklist. For examplemoving blacklist to another router would be as simple as removing a USB flash drive from one router and inserting it into the other (assuming both were set with the same storage location setting). Do not store blacklist-custom mapped files in the same location defined in **Custom path,** as the latter gets wiped periodically.
  
-For example, if you enter "%sub.domain.com", only "sub.domain.com" will be blacklisted. "Sub1.sub.domain.com", "sub2.sub.domain.com" and other subdomains will not be filtered.+ \\
  
-Prepending "+" sign to a domain entry will blacklist that domain and all subdomains and force a pruning of any subdomains found in the final blockfilePruning removes duplicate/redundant entries from the blocklist file. Duplicate or redundant entries can increase processor cycles, and RAM usage. Thus, pruning significant amounts of redudant entries can reduce CPU, memory and storage needs.+**Sort a-z ↓** **:**  introduced in release 2024.1, this sorts the field contents alphabetically.\\
  
-Any line starting with a "#" or "!" character is considered a comment and will be ignored.+ \\
  
-**Sort a-z ↓** **:**  Clicking this button sorts the contents of this field alphabetically \\+ 
 +==== Domain whitelist ==== 
 + 
 +{{:pasted:20230425-145820.png?834}}
  
  \\  \\
  
 +=== Domain whitelist syntax ===
  
-==== Domain whitelist ====+The Domain whitelist can use:
  
-{{:pasted:20230425-145820.png?778x164}}+  * Standard domains (one entry per line). 
 +  * Prepending a "%" sign before an entry indicates a "strict" whitelisting. \\ Whitelisting always takes precedence over blacklisting.\\ For example, if a blacklist contained "ads.example.com", whitelisting \\ "example.com" will undo the blacklisting of "ads.example.com" \\ and all other subdomains. 
 +  * Prepending a "#" or "!" before an entry marks it as comment only\\ it will be ignored by Adblock.
  
  \\  \\
  
-Domain whitelist can use:+This table summarizes the Domain whitelist syntax:
  
-  * Standard domains (one entry per line) + \\
-  * A path to a file of domains. For example: "/mnt/usb/my_whitelist.txt". The file must contain one domain per line. +
-  * A domain prepended with a "%" sign will indicate a "strict" whitelisting. Whitelisting always takes precedence over blacklisting. For example, if a blacklist contained "ads.example.com" , then whitelisting "example.com" will undo the blacklisting of  "ads.example.com"  and all its subdomains. +
-  * Blacklisting all subdomains may not be your goal. Whitelisting "%example.com"  will whitelist only "example.com", and will not negate blacklisting of "ads.example.com" or any of its subdomains.+
  
-Any line starting with a “#” or !” character is considered commented and ignored.+^ Adding custom entry ^ Will whitelist / Do the following ^ 
 +| sub.domain.com | sub.domain.com \\ sub2.sub.domain.com \\ and all other subdomains of sub.domain.com | 
 +| %sub.domain.com  | sub.domain.com \\ but not subdomains of sub.domain.com.\\ \\ Will also prune blockfile of dupes/redundant entries.\\ This reduces RAM usage, CPU cycles and storage space. 
 +# or !  | Any string defined before them is considered, but the rest of the line is ignored.  |
  
-**Sort a-z ↓** :  Clicking this button sorts the field content alphabetically.+ \\
  
- \\   \\+You can also specify a path to a file of domains (one domain per line). 
 + 
 +For example: "/mnt/usb/whitelist.txt"
 + 
 +Using external storage is both convenient and offers certain advantages for maintaining the blocklist. For example, moving a whitelist to another router would be as simple as removing a USB flash drive from one router and inserting it into the other (assuming both were set with the same storage location setting). Do not store you whitelist mapped file/s under the same location defined in **Custom path** as this latter gets wiped periodically. 
 + 
 +\\ **Sort a-z ↓** :  clicking this sorts the field contents alphabetically. 
 + 
 + \\
  
 === Maintaining the Domain whitelist === === Maintaining the Domain whitelist ===
  
-A good way to maintain the whitelist is to share it on your LAN, and educate users about nslookup verification and whitelist additions.+One way to maintain the whitelist is to share it on your LAN, and teach users nslookup verification and whitelist additions.
  
 Such a process could be automated as follows: Such a process could be automated as follows:
Line 254: Line 337:
     - How to use nslookup on a URL to verify DNS lookups are being poisoned     - How to use nslookup on a URL to verify DNS lookups are being poisoned
     - Where to find the whitelist (via its samba share) and;      - Where to find the whitelist (via its samba share) and; 
-    - After the whitelist has been edited, to configure settings in [[admin-buttons|Buttons/LED]] as follows: \\ \\  {{:pasted:20230125-142049.png}}\\  \\  \\ When the correct router button is pressed, these settings will trigger the ''/usr/sbin/adblock update'' function . \\ The time to complete the update may vary. A quick-run might take a few seconds. A full-run might take a few minutes.+    - After the whitelist has been edited, to configure settings in [[admin-buttons|Buttons/LED]] as follows: \\ \\  {{:pasted:20230125-142049.png?418}}\\  \\  \\ With these settings, pressing the correct router button triggers the ''/usr/sbin/adblock update'' function. \\ Update completion times vary. A swift run may take a few seconds. A full run might take minutes.
  
  \\   \\  \\   \\
Line 261: Line 344:
 ==== Enforcing Client Compliance ==== ==== Enforcing Client Compliance ====
  
-For Adblock to work properly, client devices **must be configured** to use FreshTomato's IP address (dnsmasq) as their DNS server. This can be done by configuring a static IP address on the client device itself or through FreshTomato's DHCP Service.+For Adblock to work properly, client devices **must be configured** with FreshTomato's IP address (dnsmasq) as their DNS server. This is done by configuring a static IP address on the client device itself or through FreshTomato's DHCP Service.
  
-For the latter, first enable DHCP in the [[basic-network|Network]] menuTo enable the DNS server, select "Use internal DNS" under in the [[advanced-dhcpdns|DHCP/DNS/TFTP]] menu.+For the latter, enable DHCP. Then, enable the DNS server, and select "Use internal DNS" in the [[advanced-dhcpdns|DHCP/DNS/TFTP]] menu.
  
-These steps are mandatory. Clients that bypass FreshTomato's DNS server will not have their ads blocked.+These steps are mandatory. Clients that bypass FreshTomato's DNS server won'have their ads blocked.
  
-Three optional settings help ensure proper Adblock operation:+ \\ 
 + 
 +Three optional settings improve Adblock operation: 
 + 
 + \\
  
   - Enable //Intercept DNS port// in the [[advanced-dhcpdns|DHCP/DNS/TFTP]] menu.   - Enable //Intercept DNS port// in the [[advanced-dhcpdns|DHCP/DNS/TFTP]] menu.
-  - Enable //Prevent Client auto DoH// in the [[advanced-dhcpdns|DHCP/DNS/TFTP]] menu+  - Enable //Prevent Client auto DoH// in [[advanced-dhcpdns|DHCP/DNS/TFTP]]. 
-  - Enable the "DoH Server" list in Adblock. This prevents DoH requests from being resolved.  \\ This is the default DoH Server list since release 2021.6\\  It can be found at: [[https://raw.githubusercontent.com/oneoffdallas/dohservers/master/list.txt]] \\ \\+  - Enable the "DoH Server" list in Adblock to prevent DoH requests \\ from being resolved. The default DoH Server list since 2021.6 \\ can be found at: [[https://raw.githubusercontent.com/oneoffdallas/dohservers/master/list.txt|oneoffdallas: DoH Server List]] \\ \\
  
-Adblock v1 functionality is a reduced version of ad-blocking scripts taken from code outside FreshTomato. Enabling one of those outside scripts and FreshTomato Adblock at the same time may cause conflicts. Do not enable both. Adblock v2 uses advanced methods to block ads. It should be the preferred choice whenever possible.+ \\ 
 + 
 +V1 functionality is a version of scripts from outside FreshTomato. Don't enable both an outside script and FreshTomato Adblock at the same time. It may cause conflicts. 
 + 
 +Adblock v2 uses advanced methods to block ads. It should be the preferred choice whenever possible.
  
-Adblock/DNS Filtering affects name resolution only. If an application communicates directly via IP address, Adblock cannot prevent that.+Adblock/DNS Filtering **affects name resolution only**Adblock cannot block an application that communicates directly via IP address.
  
-Thorough management of domain blocking can be tedious work. For example, with email spam, you'll probably have to deal with false positives.+Thorough management of domain blocking can be tedious. For example, with email spam, you'll probably deal with false positives.
  
-Regardless of version, the script is always named "adblock", and can be found at:  "/usr/sbin/adblock",+Regardless of version, the script is always named "adblock", and can be found at:  "/usr/sbin/adblock".
  
  \\  \\
Line 286: Line 377:
 ===== Adblock v2 ===== ===== Adblock v2 =====
  
-Adblock v2 improves on the original (v1script. V2 adds a richer feature set, with increased user interaction via toolbar and command line options.+Adblock v2 improves on the v1 script. It adds a richer feature set, increased user interaction (via toolbarand command line options.
  
- \\ \\ \\  {{:pasted:20230210-144106.png?829}}\\  \\+ \\ \\ \\  {{:pasted:20230210-144106.png?829}}\\  \\ \\
  
  
 ==== v2 Improvements ==== ==== v2 Improvements ====
  
-  * Adblock v2 performs similar basic DNS filtering functionality to v1, but in a more precise and controlled way. + \\ 
-  * Allows you to run certain script functions without having to run all of them, to save time. + 
-  * Can accept different list formats (in plain text), and extract domains from files with different layouts\\  This includes Easylist format. There may be false positives using Easylist format. For details, see: [[https://easylist.to/|https://easylist.to/]] +  - Filters DNS like v1, but in a more precisecontrolled way. 
-  * Prevents resource starvationAlso, before running, v2 assesses its configuration for blocklist capacity. It's basically self-diagnosing and healing.  +  - Lets you run only certain functions to save time. 
-  Supports Quick-run. This mode allows you to add a domain to the lists without needing to reprocess (download) entire lists again. +  - Doesn't depend on list formats, as long as they're in plain text. \\ It just extracts domains from the different list types.  
-  Supports external storage. Now, lists and headers are stored in optional permanent storage to help decide which lists to download. +  - Can prevent resource issuesIt assesses blocklist capacity before running.\\ It can self-diagnose/self-heal some basic resource problems. \\ For example: dnsmasq not running due to RAM shortage
-  Prevents false positives via a new, hard-coded 30-minute interval between runs. This is enabled after an update is completed+  Supports Swift-run mode. You can add a domain to lists without having \\ to reprocess (download) whole lists again. 
-  Includes more troubleshooting options. Debug logging and script tracing can be enabled to look deep into the \\ lowest operational level of the script. +  Supports external storage. Lists and headers can be stored there to \\ help decide which lists to download, reducing traffic/processing time
-  Can be operated from the web interface or at a command line.+  Prevents false positives via a 30-minute interval between runs.\\ This enables after updates
 +  Includes more troubleshooting options, including debug logging and \\ script tracing. These can look into the lowest operating script levels
 +  Can be operated via web interface or command line. 
 + 
 + \\
  
  \\  \\
  
-To get help with adblock at the command line, type ''adblock help'' . This will produce the following output:\\ \\ {{:pasted:20230210-141113.png?464x467|adblock help output}}\\+To get help with adblock at command line, type ''adblock help'':\\ \\ {{:pasted:20230210-141113.png?464|adblock help output}}\\
  
  \\  \\
Line 313: Line 408:
  \\  \\
  
-\\ {{:pasted:20230125-163607.png}}\\   \\  \\ \\  The additional debugging files can also be accessed at the command line by typing the command:  ''adblock status'' .+\\ {{:pasted:20230125-163607.png}}\\   \\  \\ \\ Further debugging files can be accessed at the command line by typing:  ''adblock status'':
  
- \\  {{:pasted:20230207-193120.png}}\\  \\+ \\ {{:pasted:20230207-193120.png}}\\  \\
  
- \\ \\ To open the last trace file automatically, simply type ''adblock trace'' at a command shell. You will be prompted to select the preferred viewer in which to view the trace files.+ \\ \\  \\
  
-\\ {{:pasted:20230123-133409.png?818x56}}\\  \\  \\+To open the last trace file automatically, type ''adblock trace'': 
 + 
 +{{:pasted:20230123-133409.png?909}}\\  \\  You'll be prompted to select the viewer in which to view trace files.\\
  
  \\  \\
Line 332: Line 429:
  \\  \\
  
-| {{ :pasted:20230123-173851.png?392 }} | **Load:**   (start) will try to run the script. If the script'last run was a full run and then it stopped, Load will exit the script and recover functionality (normal operation?) without a full processing of lists. This will save processing time. Load also occurs at boot time. | +| {{ :pasted:20230123-173851.png?392 }} | **Load:**   (start) will try to run the script. If the last run was a full one, and then stopped, Load will exit the script and recover functionality (normal operation?) without a full list processing. This saves processing time. Load also occurs at boot time. \\ \\ 
-| ::: | **Unload:**   (stop) stops the script, regardless of what it's doing. It will also force-kill any child process if this is to be run while the script is already loading. If a full version of the script is found and external storage enabled, Unload will move the blockfile from external storage without destroying it. This allows extremely quick load times. Unload preserves the adblock.dnsmasq file. | +| ::: | **Unload:**   (stop) stops the script, regardless what it's doing. It will force-kill any child process that is to be run while the script is already loading. If a full script version is found and external storage enabled, it will move the blockfile from external storage without deleting it. This allows very quick load times. Unload preserves the "adblock.dnsmasqfile.\\ \\ 
-| ::: | **Update:**   forces an update. There is a 30-minute interval between updates. Thus, if Update is run too often, adblock may not update, but instead, log the reason (active hold-time) it didn'update. When relevant, both GUI and command line will report the interval time. To force an update, first click Unload, and then Update. This bypasses the interval period.  +| ::: | **Update:**   forces an update. There is a 30-minute interval between updates. If Update is run too often, adblock may not update, and log why (active hold-time) it didn't. When relevant, both GUI and command line report the interval time. To force an update, click Unload, then Update. This bypasses the interval period. \\ \\ 
-| ::: | **Reset-limit: **  ''nvram unset adblock_limit'' variable and recalculate the default value for you.  +| ::: | **Reset-limit: **  ''nvram unset adblock_limit'' variable and recalculate the default value for you. \\ \\ 
-| ::: | **Clear all files:**   This is helpful when certain configuration problems occur. For exampleif files or nvram become corrupted, or if adblock_limit or dnsmasq.adblock become too large. The former can happen if adblock_limit was calculated before taking into account new or larger running processes. \\ \\ In such cases, if changing settings doesn'correct the problem, the "Clear all files" button will: \\ - Kill all adblock-related processes which are still running or stuck \\ - Delete all existing adblock-related data files from pemanent storage \\ - Delete all adblock-related data files from /etc and /tmp \\ - Restart dnsmasq without adblock, (as a last resort). \\ \\ Running Unload, Reset Limit, Clear all files is a more radical approach to resetting things.  \\ The biggest difference between clear and unload is that clear creates an environment as if adblock had never run, whereas Unload preserves adblock.dnsmasq. This makes quick-start possible when only unload has been run.  | +| ::: | **Clear all files:**   is helpful when fixing certain configuration problems, such as when files or NVRAM are corrupted, or adblock_limit or dnsmasq.adblock become too large. The former can occur if adblock_limit was calculated before considering new/larger running processes.\\ \\ If changing settings doesn'fix the problem in such cases, "Clear all files" will: \\ \\ - Kill all still running or stuck adblock-related processes. \\ - Delete all existing adblock-related data files in permanent storage\\ - Delete all adblock-related data files in "/etcand "/tmp"\\ - Restart dnsmasq without adblock, (a last resort). \\ \\ Running Unload, Reset Limit, Clear all files more radically resets things.  \\ The biggest difference between clear and unload is that clear creates an environment like adblock never run, whereas Unload preserves adblock.dnsmasq. This makes quick-start possible when only unload was run. \\  \\ 
-| ::: | **Snapshot:**   is used for troubleshooting. It captures the list of relevant files and saves it to: /tmp/adblock.snapshot.${now.in.seconds}. You can take multiple screenshots before, after and even while the script is running. A popup confirms the snapshot was taken and the file location. +| ::: | **Snapshot:**   is for troubleshooting. It captures list of relevant files and saves it to: "/tmp/adblock.snapshot.${now.in.seconds}". You can take screenshots before, after and when the script is running. A popup confirms it was taken and its location.\\  \\ \\ 
-| ::: | **Enable Only:**   In v1, to enable/disable adblock, you had to click Save. This isn'always convenient, especially if a large number of lists is loaded. This button lets you enable adblock (''nvram set adblock_enable=1'' + ''nvram commit''on the stand.  | +| ::: | **Enable Only:**   V1 required you to Save to enable/disable adblock, which wasn't convenient if many lists were loaded. This lets you enable adblock "on the fly" (''nvram set adblock_enable=1'' + ''nvram commit''). \\  \\ \\ 
-| ::: | **Disable Only:** This lets you disable adblock (''nvram set adblock_enable=0'' ''nvram commit''without having to click Save. \\ |+| ::: | **Disable Only:** lets you disable adblock without clicking Save (via: "nvram set adblock_enable=0"nvram commit)".\\  \\ |
  
  \\  \\
Line 345: Line 442:
  \\  \\
  
-Refresh: There is now a refresh command at the bottom of the table. Refreshes are limited to a minimum frequency of 5 seconds. The more frequently you run refreshes, the higher the system load will climb.+Refresh: A new command at the table bottom. Refreshes are limited to a minimum frequency of 5 seconds. Refreshing more often makes the system load climb.
  
  
-===== Quick-run (v2) and Full-run Operations =====+===== Swift-run (v2) and Full-run (v1) Operations =====
  
  \\  \\
Line 356: Line 453:
  \\  \\
  
-Modifications to the adblock script configuration can be categorized as follows:+Modifications to the adblock script configuration are categorized as follows: 
 + 
 + \\
  
   - List (enable/disable)   - List (enable/disable)
Line 370: Line 469:
  \\  \\
  
-Only two operations from the above list can be run in Quick-run mode, as they don't require full processing: +Only two operations from the above list that can be run in Swift-run mode:
- +
-  * No. (4) Addition of simple custom blacklist domain/s +
-  * No. (5) Addition of simple whitelisted domain/s+
  
  \\  \\
  
-Operations (4) and (5) are the most common actions performed when maintaining adblock script configurationQuick-run operations are performed live on a running blockfile. Therefore, the adblock script must be loaded in order to run functions (4) or (5). A quick-run can be completed in literally secondsA full-run may take minutes to complete. Any operations other than (4) or (5) above require a full-run.+  * No. 4 - Addition of simple custom blacklist domains and; 
 +  * No. 5 - Addition of simple whitelisted domains
  
-Please note that "quick" is a temporary action and will allow your change to become immediately functional. In contrast, a successive full-run (manual or scheduledwould process added domains in the standard way.+ \\ This is because they don't require full processing. 
 + 
 +These are the most common operations performed when maintaining adblock script settings. Swift-run operations are performed live on a running blockfile. Therefore, the adblock script must be loaded in order to run functions (4) or (5). A swift run can be completed in seconds. A full run may take minutes. All operations other than (4) or (5) require a full run. 
 + 
 +"Swift" is a temporary action to allow your change to become immediately functional. In contrast, a successive full run (manual or notprocesses added domains in the standard way.
  
  
 ===== Command line operations (v2) ===== ===== Command line operations (v2) =====
  
- \\  Another feature of v2 is the ability to interact with adblock via command line.  \\   \\   \\  {{:pasted:20230125-184348.png}} + \\  Another new v2 feature is the ability to interact with adblock at the command line.  \\   \\  As seen above in this "adblock help" screenshot, v2 has many more functions available:
- +
-\\+
  
  \\  \\
  
-As seen above in the "adblock help" screenshot, v2 has many more functions available to use:+{{:pasted:20230125-184348.png?550}}
  
- \\ Help+\\
  
- ''adblock help      ''   = Displays a summary guide of the valid commands.+ \\
  
- \\ Status+The table below summarizes all command switches (v2 only):
  
- ''adblock status     '' = Gives constant updates on adblock's operational status.+ \\
  
- \\ Start+^ Command  switch  ^ Type the following  ^ Performs the following task/Comments. ^ 
 +| Help  | "adblock help"  | Displays a summary guide of valid commands. \\ \\ | 
 +| Status  | "adblock status"  | Gives constant updates on adblock's operational status. \\ \\ | 
 +Start  | "adblock start"  | The same as "Load" in the Web interface. \\ \\ | 
 +| Stop  | "adblock stop"  | The same as "Unload" in the Web interface \\ \\ | 
 +| Update  | "adblock update"  | The same as "Update" in the Web interface. \\ \\ | 
 +| Upgrade  | "adblock upgrade"  | Checks online for script upgrades. If one is available, \\ it prompts you to install the upgrade. This downloads the latest script \\ version into /tmp (RAM) then mounts it over the built-in version. \\ Since the script is stored in RAM, it will be lost after a reboot. \\ Thus, an extra parameter is supported: "adblock upgrade silent". \\ If an upgrade is available, this triggers it without prompting you. \\ This may be used in the init script, to ensure the latest version runs, \\ even after a reboot. \\ \\ | 
 +| Test  | "adblock test $domain"  | Does a quick test to check a domain name is being blocked. \\ Helpful when troubleshooting. \\ \\ | 
 +| Reset  | "adblock reset"  | The same as "Reset" in the web interface. \\ \\ | 
 +| Clear  | "adblock clear"  | The same as "Clear all files" in the web interface. Resets the blockfile maximum limit. \\ \\ | 
 +| Trace/Status  | "adblock trace"  | Only available at the command line. When the script is run \\ with Loglevel set at 7, \\ adblock runs in "trace mode". \\ Every command executed by the script is saved \\ into a trace (log/debug) file. Find the trace file \\ using "adblock status". Running "adblock trace" will open the latest \\ appropriate trace file even more easily. \\ \\ | 
 +| Snapshot | "adblock snapshot" | The same as "Snapshot" in the web interface. \\ \\ | 
 +| Enable  | "adblock enable"  | The same as "Enable" in the web interface. \\ \\ | 
 +| Disable  | "adblock disable"  | The same as "Disable" in the web interface. \\ \\ |
  
- ''adblock start      '' = This is the same as "Load" in the Web interface.+ \\   \\
  
- \\ Stop 
  
- ''adblock stop      ''   This is the same ad "Unload" in the Web interface.+==== Adblock test command (v2) ====
  
- \\ Update+ \\ For quick and easy testing of broken resolution or other DNS issues, use the "test" switch.
  
- ''adblock update     '' = This is the same as "Update" in the Web interface. +Typing:  "adblock test example.com" will quickly test whether name resolution is functioning.
- +
- \\ Upgrade +
- +
- ''adblock upgrade    '' = This parameter checks online for new script versionsIf one is available, it asks if you want to install the upgrade. This is a workaround until the next release. This will download the latest version of the script into /tmp (RAM) then mount it over the built-in version. +
- +
-Since it is stored in RAM, it will be lost after a reboot. Therefore, an extra parameter is supported:  ''adblock upgrade silent'' . If an upgrade is available, this command triggers it, without prompting you. This switch may be used in the init script, to ensure the latest version runs, even after a reboot. +
- +
- \\ Test +
- +
- ''adblock test $domain''= This switch lets you quickly troubleshoot a domain name+
- +
- \\ Reset +
- +
- ''adblock reset      '' = This is same as "Reset" in the web interface. +
- +
- \\ Clear/Clean +
- +
- ''adblock clear      '' = This is the same as "Clear all files" in the web interface. It resets the blockfile maximum limit.''adblock clean'' +
- +
- \\ Trace/Status +
- +
- ''adblock trace      '' = This is a command line only function. When the script is run with Loglevel = 7, adblock is also running in "trace mode". Every command executed by the script is saved into a trace (log/debug) file. You can find the trace file using ''adblock status'' . Running ''adblock trace'' will open the latest relevant trace file for you with even less effort. +
- +
- \\ Snapshot +
- +
- ''adblock snapshot   '' = This is the same as "Snapshot" in the web interface. +
- +
- \\ Enable +
- +
- ''adblock enable    ''   = This is the same as "Enable" in the web interface. +
- +
- \\ Disable +
- +
- ''adblock disable   ''   = This is the same as "Disable" on the web interface.+
  
  \\  \\
  
- \\+{{:pasted:20230210-135935.png}}\\  \\  \\
  
- +Specifically:
-==== Adblock test command (v2) ====+
  
  \\  \\
  
-{{:pasted:20230210-135935.png}}\\  \\ +  Dnsmasq answer - Displays the actual name resolution as seen \\ by the router and LAN users. \\ The word "Blocked" is displayed if access to the domain was blocked. 
- +  * Cloudflare answer - This query bypasses the usual dnsmasq process \\ and sends a query to address 1.1.1.1 . \\ This can help verify if a domain exists. 
-To simplify and speed up testing of broken resolution or other DNS issues, use the "test" switch.  \\ Typing:  ''adblock test example.com'' will quickly verify whether name resolution is functioning. +  * Blockfile ref - Checks the blockfile for references to the tested domain.
- +
-Specifically: +
- +
-  dnsmasq answer - Displays the actual name resolution as seen by the router and LAN users. \\ The word "Blocked" is displayed if access to the domain was blocked. +
-  * Cloudflare answer - This query bypasses the usual dnsmasq process and sends a query to address 1.1.1.1 . \\ This can help you to verify if a domain exists. +
-  * Blockfile ref - This checks whether there are any references to the tested domain in the blockfile. +
- +
- \\ With these three pieces of information, you can easily assess whether a domain is blocked, non-existent, or intact. +
- +
  
 + \\ \\ With these 3 pieces of information, it's easy to assess whether a domain is blocked, non-existent, or intact.
  
  
 ===== Automatic list updates ===== ===== Automatic list updates =====
  
-As part of normal adblock operation, a crontable entry is added to perform a daily list update. Update times are now randomized to prevent DDoS of the list providers' servers. A new update time is set each time you run ''adblock stop'' or reboot. The update's time window varies between 02:00 AM and 05:59 AM local time, depending on the script version you're running (original v1, modified v1, or v2).+Normally, adblock adds a crontable entry to perform a daily list update. Now, update times are randomized to avoid DDoS of the list providers' servers. A new update time is set each time you run ''adblock stop'' or reboot. The update's time window varies between 02:00 AM and 05:59 AM local time, depending on the script version run.
  
  \\  \\
  
-To verify the current scheduled update time:+To verify the current scheduled update time, type:
  
-''root@router:/# cru l | grep adblockJob''\\ '' 28 4 * * * /usr/sbin/adblock update #adblockJob#''+''root@router:/# cru l | grep adblockJob''\\  28 4 * * * /usr/sbin/adblock update #adblockJob#
  
  \\  \\
  
-In this example, it'**28** (min) **4** (am) * (Every day) * (Every month) * (Every day of the week). +In this example, the output is **28** (min) **4** (am) * (Every day) * (Every month) * (All days of the week).
- +
-This picture illustrates the syntax of crontable expressions:+
  
  \\  \\
  
-{{::crontab-syntax.gif?400x162}}+The image below illustrates the syntax of crontable expressions: 
 + 
 + \\  \\ {{::crontab-syntax.gif?400x162}}
  
  \\  \\
Line 500: Line 567:
 ===== Future development goals ===== ===== Future development goals =====
  
-  * Add an option to let FreshTomato users share their Whitelists. \\ This would allow the creation of a shared database of "good" domains, according to users. \\ This shared whitelist would be downloaded just as you would download any blacklist. +  * Add an option to let FreshTomato users share their Whitelists. \\ This would allow creation of a shared database of "good" domains, \\ based on user experience. \\ This shared whitelist would be downloaded the same way \\ you would download any blacklist. 
-  * Add a test function to the web interface (currently only command line)+  * Add a test function to the web interface (currently only via CLI).
  
 \\ \\
Line 510: Line 577:
 ==== Troubleshooting v1 ==== ==== Troubleshooting v1 ====
  
-You can test Blacklisted or Custom entries to see if Adblock is properly redirecting them by using the nslookup tool (WindowsLinux or MacOS). Simply run nslookup and enter the domain/URL to be tested. If it resolves to 0.0.0.0, then Adblock is working properly, and the domain is being blocked. You can also check FreshTomato's System log (Syslog) to see if Adblock activity is reflected there.+You can test Blacklisted or Custom entries by using the nslookup tool (Windows/Linux/MacOS). Simply run nslookup and enter the domain/URL to be tested. If it resolves to 0.0.0.0, then Adblock is working properly, and the domain is being blocked. You can also check FreshTomato's System log (Syslog) to see if Adblock activity is reflected there. 
 + 
 + \\
  
 For example, this entry shows that dnsmasq replaced the true IP address of hbx.media.net with 0.0.0.0. For example, this entry shows that dnsmasq replaced the true IP address of hbx.media.net with 0.0.0.0.
Line 516: Line 585:
 ''Jan 9 19:57:29 rt-n66 daemon.info dnsmasq[4872]: config hbx.media.net is 0.0.0.0'' ''Jan 9 19:57:29 rt-n66 daemon.info dnsmasq[4872]: config hbx.media.net is 0.0.0.0''
  
-Adblock worked properly in this case.+Adblock worked properly.
  
-If your router crashes, you may be using too many large Blacklists, which can exhaust available RAM. Try using smaller blacklists, or fewer large ones. Adblock v2 is much less likely to experience this issue.+ \\ 
 + 
 +=== Crashing === 
 + 
 +If your router crashes, you may be using too many large Blacklists, which can exhaust available RAM. Try using smaller blacklists, or fewer large ones. Adblock v2 is much less likely to exhaust RAM. 
 + 
 + \\ 
 + 
 +=== Websites for Testing === 
 + 
 +Some websites allow you to test the effectiveness of your Adblock configuration. When using them, ensure you don't have adblock/script-block plugins enabled in your browser or your results will be invalid.
  
-There are websites available that allow you to test the effectiveness of your Adblock configuration. When doing so, please ensure you don't have any adblock/script-block plugins enabled on your browser or your results will be invalidated. Some good adblock testing sites include:+Some good adblock testing sites include:
  
   * [[https://d3ward.github.io/toolz/adblock.html]]   * [[https://d3ward.github.io/toolz/adblock.html]]
Line 527: Line 606:
  \\  \\
  
-**Adblock doesn't work with DoH and other Encrypted DNS lookups**+=== Adblock won't work with DoH, DoT and other Encrypted DNS lookups ===
  
-Increasingly, devices are using DNSSEC, and encrypted DNS protocols, such as DoH [DNS over HTTP(S)]. Adblock does not work with these DNS lookup methods. This is because if lookup requests are encrypted or directed to a third-party server, Adblock can't intercept, and therefore can't poison them.+Increasingly, devices use DNSSEC, and encrypted DNS protocols, such as DoH [DNS over HTTP(S)]. Adblock won'work with these lookup methods. This is because if lookup requests are encrypted or directed to a third-party server, Adblock can't intercept, and therefore can't poison them.
  
-As mentioned earlier, enabling the "DoH Server" in the Blacklist URL table may remedy this problem. It will download and then block access to common DoH servers.+Enabling the "DoH Server" blacklist in the Blacklist URL table may help with this. It will downloadthen block access to common DoH servers.
  
  \\  \\
Line 538: Line 617:
 ==== Troubleshooting v2 ==== ==== Troubleshooting v2 ====
  
-For troubleshooting, it is recommended that you set the loglevel setting at 7, (as described in the Settings section above). Then, analyze the logs and trace file. It's surprising how often the list providers suffer from issues such as downtime, or a broken cache. It's common to see adblock fail to download a list one day but successfully download it the next day without changes to your settings.+When troubleshooting, it's best to set the loglevel at 7, (as described in the Settings section above). Then, analyze the logs and trace file. Often the list publishers suffer from issues such as downtime, or a broken cache. It's common to see adblock fail to download a list one day but download it the next day without issue.
  
-In order to learn what might be going wrong, it's crucial to understand adblock's status indicators. Here are a few signs which may indicate a problem:+ \\ 
 + 
 +In order to learn what might be wrong, you should understand adblock's status indicators. 
 + 
 +Here are a few signs which may indicate a problem:
  
   * System load is too high in the 5min+ section (For example, > 1.5)   * System load is too high in the 5min+ section (For example, > 1.5)
   * RAM usage is too high (> 90%)   * RAM usage is too high (> 90%)
-  * dnsmasq ownership remains root (non-operational) until lists are fully loaded. It's normal to see "root" briefly, but this should switch to "nobody" within 20 seconds.+  * Dnsmasq ownership remains root (non-operational) until lists are fully loaded. \\ It's normal to see "root" briefly, but this should switch to "nobody" within 20 seconds.
   * Too many dnsmasq restarts   * Too many dnsmasq restarts
-  * dnsmasq restart time is too high (> 15 seconds) +  * Dnsmasq restart time is too high (> 15 seconds) 
-  * adblock calls today +  * Adblock calls today 
-  * last run errors+  * Last run errors
  
  \\  \\
  
-If the Blockfile size exceeds the //Blockfile size limit// value, the blockfile size will be reduced. If (with limit manually set high) dnsmasq still struggles to run properly after this, the safeDnsmasqRestart() process will reduce the Blockfile size in increments of 5% and reattempt to fully start dnsmasq after each reduction. When dnsmasq functions properly, the new auto-calculated limit is set as the current //Blockfile size limit//.+If the Blockfile size exceeds the //Blockfile size limit// value, the file size will be reduced. If (with limit manually set high) dnsmasq still doesn'run properly afterwards, the safeDnsmasqRestart() process will reduce the Blockfile size in increments of 5%. After each reduction, it will reattempt to fully start dnsmasq. When dnsmasq functions properly, the new auto-calculated limit is set as the current //Blockfile size limit//.
  
  \\  \\
Line 560: Line 643:
  \\  {{:pasted:20230207-193120.png}}\\  \\  \\  {{:pasted:20230207-193120.png}}\\  \\
  
- \\ \\ To open the last trace file automatically, simply type ''adblock trace'' at a command shell. You will be prompted to select the preferred viewer in which to view the trace files.+ \\ \\ To open the last trace file automatically, type ''adblock trace'' at a command shell. You'll be prompted to select the viewer in which to view trace files.
  
-\\ {{:pasted:20230123-133409.png?818x56}}\\  \\  \\+\\ {{:pasted:20230123-133409.png?909}}\\  \\  \\
  
  \\  \\
Line 568: Line 651:
  \\  \\
  
-**Apple iOS devices (paid iCloud service only)**+**Apple iOS devices (iCloud paid service only)**
  
-Apple IOS devices have settings that may interfere with adblock operationsThe "Limit Address Tracking" option can be disabled on a per WLAN basis, as seen in the image below:+iOS devices have settings which may interfere with Adblock operation. "Limit Address Tracking" \\ can be disabled on a per-WLAN basis, seen here: 
 + 
 + \\ {{:pasted:20230124-162651.png?565}}
  
  \\  \\
  
-{{:pasted:20230124-162651.png?573}}+ \\ \\ {{:pasted:20230124-162536.png?447}}\\
  
-\\  {{:pasted:20230124-162536.png?558}}\\+ \\
  
  \\  \\
  
-Alternatively, you can disable this globally via the "Private Relay" setting, as seen here:+Alternatively, you can disable it globally via the "Private Relay" setting, seen below:
  
  \\  \\
Line 586: Line 671:
 {{:pasted:20220611-144641.png}}\\ \\ {{:pasted:20220611-144641.png}}\\ \\
  
-You might connect your mobile/laptop to different wireless networks at different locations. For this reason, it makes sense to disable Private Relay on a per WLAN basis. It is advised that you disable it wherever FreshTomato provides your Internet connection and Adblock is running.+ \\
  
-Remember, these options are only available for paid iCloud customers.+You might connect your mobile/laptop to different WiFi networks at different locations. For this reason, it makes sense to disable Private Relay on a per-WLAN basis. It is wise to disable it wherever FreshTomato provides your Internet connection and Adblock is enabled. 
 + 
 + \\ 
 + 
 +Remember, these options are only available to //paid// iCloud customers. 
 + 
 + \\ 
 + 
 + \\
  
  
advanced-adblock.1691252446.txt.gz · Last modified: by hogwild