How to let routers intercept ads

  

For every friend who likes to surf the Internet, almost every website will be bombarded with various advertisements. Even if you enter the wrong URL, the operator's DNS interception will force the advertisement. Although we can block ads through the browser's blocking ad plugin, is it possible to intercept the ad when it breaks into the computer? Why not use the router's settings to directly block ads in the "window" outside?
Small knowledge: How does the router intercept ads? Friends who have used the browser hosts file to block ads know that hosts are advertised by the domain name turn (pointing common ad domain names to 127.0.0.1). The router intercepts the advertisement similarly. It uses the widely existing Dnsmasq service on the router and the built-in IP address filtering and domain name filtering component of the router to realize that the advertisement URL is turned to 127.0.0.1 on the router, thereby shielding the advertisement. Simple three-step —— Shielding operator DNS advertisements Users who use Telecom and China Unicom to access the Internet know that many times we visit some websites and jump to the telecom advertisement page for no reason, or automatically jump when accessing non-existent URLs. To the carrier's advertising page, these are typical DNS ad hijackings. They can now be easily blocked with router settings. The following is an example of shielding telecom DNS advertisement hijacking. The router uses Tplink WR541G/542G. 1. Use IE browser to enter the router settings, and then expand the left pane's "Security Settings & Rarr; Firewall Settings", select the "IP address filtering" under the "Filtering" option, select the default filtering rules: Packets that do not meet the IP address filtering rules are allowed to pass through this router. Continue to check “domain name filtering” and save (see Figure 1). 2. In the right pane, switch to “Security Settings →Domain Filtering", click “Add New Entry", add the following domain name as prompted (do not enter http://www.format), these will DNS advertising domain names are all filtered, effective time is "00~24" (ie, every day), the status is "effective" (see Figure 2): search.114.vnet.cn114.vnet.cn Tip: each operation The domain name of the commercial is not the same. Just enter a non-existent URL such as www.lokdhhgffdfds.cxm in the browser. The page that jumps to this is the carrier's advertising URL. Write down its domain name in the address bar and add it to the domain name. Filter the list. 3. Start a command prompt and enter the following command to obtain the IP address of the above domain name and write it down. Then set the pane on the right, switch to “security settings →IP address filtering", click “add entry”, then in the pop-up window, fill in the "WAN IP address" input box The IP address obtained above (if the ad URL is a network segment, enter the starting IP address segment), select the default settings for other parameters, and click OK to restart the route (see Figure 3). Ping search.114.vnet.cnping 114.vnet.cn After surfing the Internet again, since the carrier's advertising domain name and P address are all automatically filtered, there will be no DNS advertisement hijacking in our browser. Once the operator has added a new ad, the operation continues to be added to the domain name and IP address filtering list. Similarly, for common dangerous domain names and URLs, the same method can be used to block in the router. Note: If the setting is not correct (such as setting the firewall rule to “ any packet that does not meet the IP address filtering rule, prohibiting the router from passing through this router) may cause the Internet to be unavailable. At this time, just enter the router setting again and select &ldquo ; Restore factory settings & rdquo;, or physically clear the router, and then according to the tutorial to make the correct settings. Upgrade router ——block common webpage advertisements The above method can only manually add the domain name and IP address to be filtered, so it is only suitable for blocking a small number of typical advertisement URLs. For a large number of online advertising pages, we can't add them all manually. If your router supports DD-WRT, you can easily block all kinds of ads with DD-WRT. Tip: DD-WRT is a non-commercial third-party firmware that can be used with some wireless routers to support multiple brands of routers. Its powerful and friendly web management/configuration interface provides a lot of features that are not supported by the router. The specific supported router brands can log in to http://www.dd-wrt.com/site/index View. After a normal router is swiped into DD-WRT, it can block most ad pages with its own DNSMasq service. 1. Go to the DD-WRT Routing Settings page, expand “Services → Services. In the DNSMasq setting option at the bottom of the page, set both DNSMasq and Local DNS to Enable. Enable) and save the settings (see Figure 4). Spe2. Go to http://dwz.cn/cfan28 to download the required script file, open it with Notepad and copy everything. Return to the DD-WRT routing settings page, continue to expand the "Administration (administrator) & rarr; Commmands (command line)" above the page, paste the above copied script in the text box after the "Command Shell" (command line shell) After the file is pasted, click “Save Startup” to save it as a boot project (see Figure 5). Tip: The role of the above script is actually to achieve automatic download of Chinalist every time you start the router (the famous anti-advertising extension Adblock Plus uses ChinaList Lazy filter package for domestic advertising, it will update the advertisement list regularly), and then convert and generate dnsmasq configuration file after downloading. , then tell dnsmasq to call. 3. Continue to expand “Administration & Rarr; Management” and find the “cron” option in the right pane, set it to “Enable” and then “Additional” below. Cron Jobs” text box input “* 1 * * * root /tmp/.rc_startup” code, and finally save and exit. After completing the above settings, each time we start the router, it will automatically download and automatically download Chinalist and be called by the router. The effect of blocking is similar to the Adblock Plus plug-in installed in the browser. You can compare it yourself. Tip: For routers that cannot swipe DD-WRT, we can use the list of domain names provided by Chinalist. Just enter http://easylist-msie.adblockplus.org/chinalist+easylist.tpl periodically in the browser address bar. The same effect can be achieved by manually adding the domain name to the router's domain name filtering list. This article comes from [System Home] www.xp85.com

Copyright © Windows knowledge All Rights Reserved