In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article is about how to use raspberry pie and Pi-hole to block ads on your network. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
Pi-hole blocks more than 100000 domain names that provide ads, it can block ads on any device (including mobile devices, tablets, and PCs), and it completely blocks ads, rather than just hiding them, which improves overall network performance (because ads don't need to be downloaded). You can monitor performance and statistics on a web interface, or you can use an API.
You need to:
Raspberry pie + SD card
USB power cord
Ethernet cable
You don't need to use a * raspberry pie-an old one is enough to do the job, as long as it has no less memory than the 512MB-so a first-generation raspberry pie Model B (rev 2) is enough, a Model B +, or a second-or third-generation raspberry pie. You can use Pi Zero, but you need an USB micro Ethernet adapter. You can use a Pi Zero W with WiFi instead of Ethernet. However, as part of your network infrastructure, I recommend that you use a good and stable wired connection instead of a WiFi connection.
Prepare the SD card
For the first step, you may need to install Raspbian Stretch Lite on a SD card. The SD card needs to be at least 4GB size (the full desktop Raspbian image needs to be at least 8GB, but the Lite image is smaller and lighter enough to do the job). You can also use a full Raspbian desktop image if you like, but as a raspberry pie to run simple applications, you don't have to do much more.
Using your PC, download the Raspbian Stretch Lite image from the raspberry pie website. Extract it and extract the .img file inside, and then write the .img file to your SD card. Whether your SD card is blank or not, this step will not be troublesome, because it will empty the data on it before writing it.
If you are using Linux, an easier way to write to the image is to use the command line tool dd. Alternatively, you can use the cross-platform software Etcher (refer to Les Pounder's guide on how to prepare a SD card for raspberry pie).
When the SD card is ready, you can plug it into your raspberry pie, connect the keyboard, monitor and Ethernet, and then power the raspberry pie. After initializing the settings, the raspberry pie does not need a keyboard or monitor. If you have experience working with "endless headless" raspberry pie, you can enable SSH and then set it to enable remote connections.
Install Pi-hole
After your raspberry pie guide is complete, log in with the default user name (pi) and password (raspberry). Now you can run the command line and install Pi-hole. Simply enter the following command and enter:
Curl-sSL https://install.pi-hole.net | bash
This command downloads the Pi-hole installation script and runs it. You can type https://install.pi-hole.net in your computer browser to see its contents, and you will see what the script does. It generates an administrator password for you and displays it on your screen along with other installation information.
It's that simple. In a few minutes, your raspberry pie will be ready to intercept commercials for you.
Before you disconnect the raspberry pie, you need to know its IP address and the IP address of your router. (if you don't know), type hostname-I in your terminal to see the IP address of your raspberry pie, and type ip route | grep default to find the IP address of your router. What you will see is an address like 192.168.1.1.
Configure your router
Your raspberry pie now runs a DNS server, and then you need to tell your router to use Pi-hole as its DNS server instead of the default DNS provided by your ISP. Enter the management console web interface of the router. This interface is usually entered by entering the IP address of your router.
Find the DHCP/DNS settings below the LAN settings, and then set the IP address of your main DNS server to the IP address of your Pi-hole. After the setup is complete, it should look like the following image:
For more information on this step, see Pi-hole discourse.
You also need to make sure that your Pi-hole always keeps the same IP address, so you need to check the DHCP settings and add your raspberry pie IP address entry to the reserved address.
External testing
Now, at the command line, type sudo halt to turn off the running raspberry pie and power it off. You can unplug the monitor cable and keyboard, and then put your raspberry pie in a suitable fixed place-maybe you should put it near your router. Make sure the Ethernet cable is connected, and then reconnect the power to start it.
Navigate to a website on your PC (it is highly recommended to visit the Opensource.com website), or use one of your WiFi devices to check that your Internet access is normal (if not, your DNS may be misconfigured). If you see the expected results in the browser, it works fine. Now, when you browse the website, you should never see the advertisement again! Even ads provided in your app will not appear on your mobile device! Have a good time surfing!
If you want to test your new ad blocking feature, you can go to this test page and try some sites with built-in ads.
Now you can type the IP address of Pi-hole into your computer browser to access its web interface (for example, http://192.168.1.4/admin or http://pi.hole/admin may also work). You will see the Pi-hole admin panel and some statistics (the number may be small at this time). After you enter the password (displayed on the screen during installation), you will see a more beautiful graphical interface:
You can also fine-tune your Pi-hole settings, such as whitelist and blacklist of domain names, * * and temporary prohibitions, access blocking statistics, and so on.
In individual cases, you may need to upgrade your Pi-hole installation. When the software needs to be updated, an update prompt appears on the web interface. If you enable SSH, you can log in remotely, otherwise, you will have to connect the keyboard and monitor again. After logging in remotely, enter the pihole-up command to update it.
Thank you for reading! This is the end of the article on "how to use raspberry pie and Pi-hole to block ads on your network". I hope the above content can be helpful to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.