Deadwood 主要的特點之一是能夠簡單配置並執行多層次的封鎖機制,例如對特定 IP 地址或網域進行封鎖。此外,它還支持基於哈希值進行封鎖,從而增強了其對抗廣告、間諜軟體及其他惡意軟體的能力,這一點在數位隱私保護中有很高的價值[2]。
1.2 Deadwood的DNS封鎖與隱私保護應用:
隨著網路安全和數位隱私問題的日益嚴峻,許多研究聚焦於如何利用 DNS 伺服器來提升網路使用者的隱私保護[3]。Deadwood 作為一個開源的 DNS 解決方案,其封鎖功能在防止廣告追蹤、阻止惡意軟體的行為中發揮了顯著作用。根據[4]的研究,Deadwood 能夠有效地過濾惡意網站和無意義的廣告請求,從而減少個人資料洩漏的風險。
在類似的 DNS 封鎖技術中,有多種其他解決方案被提出並應用於現實世界中。比如,Pi-hole 是另一個常見的 DNS 層封鎖工具,提供了廣告封鎖和過濾功能。相比之下,Deadwood 的主要優勢在於其簡單的設置與輕量級的運行需求[6]。儘管 Pi-hole 提供了一些額外的功能和圖形介面,但 Deadwood 的效能和資源消耗上卻具有更好的可伸縮性,特別是在需要處理大量 DNS 查詢的情況下[7]。
1.4 Deadwood 在企業環境中的應用:
Deadwood 亦被廣泛應用於企業內部網路的 DNS 查詢過濾。在一些需要保護機密資料和防範外部攻擊的企業環境中,Deadwood 的 DNS 封鎖功能能夠有效地限制來自外部的惡意連線。透過配置適當的封鎖列表和自定義設定,企業能夠在不降低系統效能的情況下,提供強有力的網路安全防護[8]。
1.5 Deadwood與其他技術的整合應用:
Deadwood 不僅能作為獨立的 DNS 伺服器運行,還可以與其他網路安全技術協同工作,例如防火牆、VPN 及入侵檢測系統。當結合這些技術時,Deadwood 能夠提供更高層次的保護,並有效減少內部網路受到外部攻擊的風險[9]。
二、系統架構與工具:
2.1 Deadwood 簡介:
Deadwood 為 MaraDNS 專案之子計畫,是一款針對速度與記憶體需求進行最佳化的 DNS 前端快取伺服器。其支援上游遞迴查詢、多來源封鎖與自訂 IP 映射等功能,適合嵌入式系統或進階 DNS 控制需求。
2.2 系統組成圖:
[Client Device] <---> [Deadwood DNS Server] <---> [Upstream DNS or Internet]
│
├─ blocked_hosts.txt (域名黑名單)
├─ badhosts.bin (編譯後的黑名單)
└─ dwood3rc.txt (主設定檔)
2.3 適用平台(Tested & Recommended Platforms):
Deadwood 是由 MaraDNS 專案所提供的輕量級 DNS 伺服器,具備良好的可攜性與平台兼容性。本研究使用的 Deadwood 版本與相關封鎖設定,可成功運作於以下作業系統:
實測成功平台:
Windows XP SP3
(支援基本 DNS 架設與 Deadwood 運行,適合老舊機種或虛擬環境測試)
Windows 7 / Windows 8.1
Windows 10(建議 64-bit)
Windows 11
Windows Server 2008 R2 / 2012 / 2016 / 2019 / 2022
(適用於企業級內網或 Proxy 架構中部署作為遞迴 DNS 層)
# Lines with a '#' at the beginning are comments ignored by Deadwood's
# text file parser.
# If you wish to use this program to cache from other recursive servers
# instead of the Quad9 servers, uncomment the following lines.
# Replace the IPs if needed.
upstream_servers = {}
upstream_servers["."]="8.8.8.8, 168.95.1.1" # Servers we connect to
# It is also possible to use ICANN root servers. However, to do this,
# root_servers needs to be defined.
#root_servers = {}
# ICANN DNS root servers
#root_servers["."]="198.41.0.4, 199.9.14.201, 192.33.4.12, 199.7.91.13,"
#root_servers["."]+="192.203.230.10, 192.5.5.241, 192.112.36.4, "
#root_servers["."]+="198.97.190.53, 192.36.148.17, 192.58.128.30, "
#root_servers["."]+="193.0.14.129, 199.7.83.42, 202.12.27.33"
# The IP this program has
bind_address="0.0.0.0"
# The IPs allowed to connect and use the cache
recursive_acl = "0.0.0.0/0"
# This is the file Deadwood uses to read the cache to and from disk
cache_file = "dw_cache_bin"
# This is a list of IPs that, if we get them in a DNS reply, we convert
# the reply in to a "not there" answer.
#ip_blocklist = "10.222.33.44, 10.222.3.55"
# By default, for security reasons, Deadwood does not allow IPs in the
# 192.168.x.x, 172.[16-31].x.x, 10.x.x.x, 127.x.x.x, 169.254.x.x,
# 224.x.x.x, or 0.0.x.x range. If using Deadwood to resolve names
# on an internal network, uncomment the following line:
#filter_rfc1918 = 0
# We can have given names resolve to bogus IPv4 addresses. Here, we
# have the name "maradns.foo" resolve to "10.10.10.10" and "kabah.foo"
# resolve to "10.11.11.11", regardless of what real values these DNS
# records may have. Note that a given name can only resolve to a
# single IP, and that the records have a fixed TTL of 30 seconds.
ip4 = {}
ip4["maradns.foo."] = "10.10.10.10"
ip4["kabah.foo."] = "10.11.11.11"
#ip4["x.abc.foo."] = "10.11.11.11"
# Blacklist a bad site; this blocks resolution for both IPv4 and IPv6
ip4["phish.example.com."] = "X"
# We can also use a similar syntax to have bogus IPv6 addresses.
# We don't use standard notation for IPv6 addresses. Instead, we
# we use 32-character hex addresses (case insensitive); to make
# it easier to count long strings of "0"s, the "_" acts like a 0.
# We ignore "-" and " " (space) in ip6 strings.
ip6 = {}
ip6["maradns.foo."] = "20010db84d617261444e530000001234"
ip6["kabah.foo."] = "2001-0DB8-4D61-7261 444E-5300-__00-2345"