Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> ระบบเครือข่าย >> อินเทอร์เน็ต

Pi-Hole: จัดการ DNS บล็อกโฆษณาและปกป้องความเป็นส่วนตัว

Modern Internet 令人煩躁 无辜 活动 读文字 看视频 被 Promotional Messages (Ads) 中断 如果 Ads Relevant Well-timed Non-intrusive 不成问题 但 尽管 AI Deep Learning Buzzwords 进步 它们 都不是 然后 有 Privacy

Battle Ad Givers vs Ad Blockers 持续 升级 越来越多人 反对 Aggressive In-yer-face Ad Model 大部分 用 Adblocking Extension Browser All Set 但 受制于 Browser Company 允许什么 加上 不总是 Work Every Browser/OS Solution: 完整 Block Network Requests 到 Ad Servers 这就是 Pi-Hole 做的 来 Review

Pi-Hole: จัดการ DNS บล็อกโฆษณาและปกป้องความเป็นส่วนตัว

Getting Started (เริ่มต้น)

Pi-Hole = Black Hole for Internet Advertisers Software Tools Block DNS Requests 到 Domains Identified Ad Serving 这样 Browsing Sessions - 或 任何 Internet-facing Activity - 绝不 包含 Advertising Network-level Solution 应该 Work All Scenarios Benefits: Reduced Noise, Reduced Traffic Volume, Improved Privacy

Intrigued 决定 Setup Pi-Hole 通常 设计 用作 Appliance 名字 暗示 用 廉价 Raspberry Pi Device Install Pi-Hole 用作 Network Filter Problem #1: 需要 Networking Understanding Configure Correctly Complete Solution Covers:

  • Setup Device Run Pi-Hole - Dedicated System Network 或 Configure Pi-hole 任何 Linux Machine 例如 双 Linux Laptops/Desktop 各自 Network Filter
  • Configure Pi-Hole as DNS Server - 我们 用 Domain Names 不是 IP Addresses 记忆 dedoimedo.com 容易กว่า 1.2.3.4 DNS Resolution Service 做 Translation Pi-Hole Apply Filtering Rules 这里 Identify Request Ad Address Drop Request Content Never Served 当然 False Positives 可能
  • Configure Other Systems 使用 Pi-Hole as DNS Server - 需要 Networking Knowledge 但 适用 任何 OS Pi-Hole Appliance Linux 但 任何 Machine 更改 DNS Config 使用 Appliance 从那时起 Pi-Hole Middleman Filtering Network Requests

จำได้ ทั้งหมด ต้อง Expertise 不能 Casual Plug'n'play 但 Nerdy Friend 可能 做 给你 简单/复杂 继续看

Installation Wizard

Download Script Run Text-based Wizard Relatively Simple Follow รัน KDE Neon 只 Install Software System Repos 除了 Own Components GitHub

Pi-Hole: จัดการ DNS บล็อกโฆษณาและปกป้องความเป็นส่วนตัว Pi-Hole: จัดการ DNS บล็อกโฆษณาและปกป้องความเป็นส่วนตัว Pi-Hole: จัดการ DNS บล็อกโฆษณาและปกป้องความเป็นส่วนตัว

บอก Pi-Hole DNS ใช้อะไร 例如 Router (Typical Linux) 192.168.1.1 หรือ 192.168.2.1 Systemd ทำให้ ยากเข้าใจ 但 会 到达 选项 使用 Internet DNS (Google/CloudFlare) เริ่ม Custom Setup

Pi-Hole: จัดการ DNS บล็อกโฆษณาและปกป้องความเป็นส่วนตัว

像 Adblocker Pi-Hole 用 Lists Block Ads Strongest/Weakest Link 如果 Lists Not Up-to-date Inaccurate Badly Made Gaps/False Positives Legitimate Domains Rejected 但 Browser Extensions 差不多 除了 更 Thorough 因此 Aggressive Browser Extensions Apply Rules 只 Third-party Domains Expected Domain Misbehave 低 Pi-Hole Foolproof 防止 Legit Sites Load

Pi-Hole: จัดการ DNS บล็อกโฆษณาและปกป้องความเป็นส่วนตัว

Web UI 听起来 不错 Configured

Pi-Hole: จัดการ DNS บล็อกโฆษณาและปกป้องความเป็นส่วนตัว

完成 Supposedly Installed/Configured 可以 使用 现在

Did it work? (มันทำงานไหม?)

Nope 没有 Internet Connectivity - Failure Name Resolution Local System (Neon) 使用 自己 as DNS (或 Pi-Hole 使用 Router) 但 Pi-Hole 不 Provide Resolution Service

问题: 不能 Online 搜答案 需要 Another Machine 卸载 Pi-Hole Simple Clean Connectivity Restored 立即 装又 一样结果

Command-line Checks Pi-Hole Commands Enable/Disable Start Name Resolution Check Status 原来 Problem: pihole-FTL

pihole enable
  [i] Enabling blocking
  [✗] pihole-FTL: no process found
  [✓] Pi-hole Enabled

Run pihole-FTL 不 Start 原来 Need Sudo Online Docs Setup Errors Not Well Documented 似乎 过 First Hurdle

pihole-FTL
FATAL: Opening of FTL log (/var/log/pihole-FTL.log) failed!
       Make sure it exists and is writeable by user neon

sudo pihole-FTL
FTL started!

但 还是 没 Internet DNS Service Down 试 Restart

pihole restartdns
  [✗] Failed to start pihole-FTL.service: Unit pihole-FTL.service not found.

从 Error 猜 没有 Unit File Start FTL Service 或 Borked Search Online 学到 Service File 需要 改 /etc/init.d/pihole-FTL Edit Line Invokes FTL จาก:

su -s /bin/sh -c "/usr/bin/pihole-FTL" "$FTLUSER"

成 这 行:

/usr/bin/pihole-FTL

后 Pi-Hole Start No Errors

sudo pihole restartdns
  [✓] Starting DNS service

Pi-Hole wasn't blocking ads (Pi-Hole ไม่บล็อกโฆษณา)

有 Connectivity 但 Ads ยังอยู่ Pi-Hole 不 Filter 进 Web UI 做 Changes/Tweaks 但 进 Pi-Hole Address 没有 Web Server Listening https://ip-address/admin https://pi-hole/admin 没反应

Command Line 测试 发现 lighttpd Service Not Running 解釋 为何 没 Web UI 做 Wizardry 又 Docs Sparse Hit More Errors:

sudo systemctl restart lighttpd.service
Job for lighttpd.service failed because the control process exited with error code. See "systemctl status lighttpd.service" and "journalctl -xe" for details.

这次 有 Internet 搜 Online 找到 原因 - 虽然 Error Logs 没 任何东西 指示 Solution 再次 指出 Systemd Undecipherable Complexity 搜索 Binary Log 即使 信息 Useless

其实 Missing Package - gamin 为何 不 Install as Dependency 不知道 装完 lighttpd Start Fine Web UI 探索

sudo apt-get install gamin

systemctl status lighttpd.service
● lighttpd.service - Lighttpd Daemon
  Loaded: loaded (/lib/systemd/system/lighttpd.service; enabled; vendor preset: enabled)
  Active: active (running) since Thu 2019-05-09 15:34:03 CEST; 2s ago
 Process: 19060 ExecStartPre=/usr/sbin/lighttpd -tt -f /etc/lighttpd/lighttpd.conf (code=exited, status=0/SUCCESS)
Main PID: 19069 (lighttpd)
   Tasks: 6 (limit: 4915)
  CGroup: /system.slice/lighttpd.service
          ├─19069 /usr/sbin/lighttpd -D -f /etc/lighttpd/lighttpd.conf
          ├─19078 /usr/bin/php-cgi
          ├─19079 /usr/bin/php-cgi
          ├─19080 /usr/bin/php-cgi
          ├─19081 /usr/bin/php-cgi
          └─19082 /usr/bin/php-cgi

Pi-Hole: จัดการ DNS บล็อกโฆษณาและปกป้องความเป็นส่วนตัว

Web UI Login and Password

但 还是 没 Ads Blocked 试 Login 发现 另一 问题: 不能 Access Admin Page Check Logs/Details/Changes 再搜 Online 发现 Reset Default Password Command Line:

pihole -a -p

然后 有 Web UI Settings 很 Nice Powerful Interface 很多 Options 包括 Temporarily Stop Pi-Hole 遇到 问题 Pause Filtering 不用 玩 DNS Settings

Populate Blocklists

通过 Interface 发现 Blocklists 全空 从 Main Page 明显 但 要知道 看什么 为何 Pi-Hole 不 Prompt Update Lists 或 做 Setup 一部分? Manual Update Command Line Lists Generated

pihole -g -f

Pi-Hole: จัดการ DNS บล็อกโฆษณาและปกป้องความเป็นส่วนตัว

All right, did it work? (ดีแล้ว ทำงานไหม?)

Yes 终于 Working! Pi-Hole DNS Duty Filtering Traffic Effective Non-intrusive 甚至 Slight Performance Boost Network Side 处理 Queries 少 Serve Less Content Innocent Browsing 20% Queries Blocked 聽起來 多 但 突出 Modern Internet 现状 100,000+ Domains Blocklist 讲述 悲伤 故事 也 解释 Gentle Latency Improvement

Pi-Hole: จัดการ DNS บล็อกโฆษณาและปกป้องความเป็นส่วนตัว

สรุป

วันสิ้นสุด Pi-hole Running 但 Setup Far from Trivial 4-5 Cardinal Problems ไหนควรเกิด Installation Wizard Could Separate Checks 确保 Things Working First-run: Service Check FTL Up Web Service Password Reset List Update 所有 这些 Streamlined Experience

作为 产品 Pi-Hole Very Nice Powerful Tool 做工作 Extremely Well Fast Effective Robust Web UI Nicely Designed Gain Traffic Side Less Content Served Fewer Queries Resolved Performance Improvement Stuff Matters Setup 不 Trivial 但 Achievable 很多 Flexibility Wire Network Standalone Pi-Hole 或 Serve All Devices Home All in All Doomsday Weapon If/When Internet Turns Rogue Well Worth Testing 但 记住 Thermodynamics Second Rule: Can't Have Trivial 和 Complex 同一时间

Cheers.