Building My Home Server Part 2 (Pi-Hole | Fail2Ban | UFW)
Ads are rarely popular. They often feel intrusive, annoying, and disruptive. On top of that, they usually come bundled with tracking cookies and analytics scripts that send data back to the source—yet despite all this information, the ads rarely end up being genuinely useful or relevant.
Pi-Hole
Pi-hole is a DNS—and optionally DHCP—server that blocks domains linked to ads and unwanted content. It’s free, open source, and true to its name, it can run efficiently on a Raspberry Pi, though it also works well on other popular Linux distributions.
Fail2Ban
If you're running a Unix-based system, especially a public-facing server, security should be at the top of your priorities. That’s where Fail2Ban comes in. It’s a powerful and flexible intrusion prevention tool that keeps a close eye on your system’s log files, looking for signs of malicious behavior—like repeated failed login attempts or brute-force attacks. When it spots something suspicious, it steps in and automatically bans the offending IP address, helping to stop attackers in their tracks before they can do real damage.
To view the list of banned IP addresses from Fail2Ban you can use the code sudo fail2ban-client status
This will display a list like the one below.
UFW
UFW stands for Uncomplicated Firewall, and it’s a tool that simplifies firewall management on Linux systems, especially Ubuntu and Debian-based distributions. Under the hood, it uses the powerful iptables framework but wraps it in a straightforward interface that anyone can use. Whether you want to allow web traffic, block suspicious IPs, or secure SSH access, UFW makes it easy to configure without needing to write complex rules.