In today’s internet infrastructure, DNSSEC (Domain Name System Security Extensions) plays a vital role in preventing forged or tampered DNS responses.This guide walks you step-by-step through creating a new DNS zone and enabling DNSSEC signing to ensure data integrity and trust. 1. What Is DNSSEC? DNSSEC adds cryptographic signatures to DNS records, allowing clients (resolvers)…
Blog
從零開始設定 DNSSEC:打造安全的 DNS Zone
在 DNS 架構中,DNSSEC (DNS Security Extensions) 能有效防止 DNS 資料被偽造或竄改。本文將一步步帶你完成一個新的 DNS 區域設定,並加入 DNSSEC 簽章,建立安全可信的名稱解析環境。 一、什麼是 DNSSEC? DNSSEC 透過「公開金鑰簽章」來保護 DNS 資料完整性。簡單來說,它會讓查詢者能驗證 DNS 回應是否真的來自授權的 DNS 伺服器,而不是中途被竄改。 主要機制包含: 二、建立新區域前的準備 三、建立新的 Zone 檔案 建立 /etc/bind/db.example.com,內容如下: 四、在 BIND 設定中加入 Zone 編輯 /etc/bind/named.conf.local: auto-dnssec maintain 與 inline-signing yes 會讓 BIND 自動處理簽章與金鑰輪換。 五、產生 DNSSEC 金鑰 在金鑰目錄(例如 /etc/bind/keys/)中執行: 系統會產生四個檔案: 六、簽署 Zone 重新載入 BIND 讓它執行自動簽章:…
Building a Split-Horizon + DNSSEC Authoritative/Recursive DNS with BIND 9.21
This post turns my containerized BIND 9.21 deployment notes into a step-by-step guide. To protect the real environment, all domains are anonymized as domainA and domainB, and public IPs are shown as examples (e.g., 203.0.113.0/24). Target Architecture Recommended Directory Layout Key points: put all K* key files + .state in /var/cache/bind/keys; keep managed-keys.bind* and *.mkeys*…
用 BIND 9.21 打造「內外分流 + DNSSEC」權威/遞迴混合 DNS:完整實戰筆記
本文將我在容器內部署 BIND 9.21 的完整過程整理成一篇教學。為保護實際環境,所有網域以 domainA、domainB 代稱,IP 也以示例地址(如 203.0.113.0/24)呈現。 目標架構 目錄佈局(建議) 重點:K* 金鑰與 .state 一律放 /var/cache/bind/keys;managed-keys.bind*、*.mkeys* 放 /var/cache/bind 根目錄;external 區檔放 /var/cache/bind/zones/ext。 關鍵設定片段 1) options:工作目錄、金鑰目錄、僅 IPv4 監聽 2) RNDC 控制通道(只綁 127.0.0.1) 如果容器外要下 rndc,要能讀到同一把 rndc.key,或在容器內執行。 3) internal view:內網權威 + 遞迴(不做 DNSSEC 驗證) 4) external view:對外權威(簽名),只對本機開遞迴+驗證供 KASP 使用 TSIG:請用 tsig-keygen -a hmac-sha256 xfr-key > /etc/bind/keys/xfr-key.key 產生,主從兩邊都 include,從伺服器 zone {…
Implementing a Shared Sinkhole Zone in BIND — and What to Know About DNSSEC
Author: Rico Wu | Topic: DNS Security & Infrastructure 1. Why Create a Sinkhole Zone? When reviewing your DNS logs, you might often see queries like: Some of these come from automated scanners or bots, and others are legitimate DNSSEC lookups.However, domains like wpad (Web Proxy Auto Discovery) can sometimes be abused for malicious purposes…
BIND 共用 Sinkhole Zone 實作與 DNSSEC 管理要點
作者:Rico Wu | 主題:DNS 防護實務 一、為什麼要建立 Sinkhole Zone? 在日常 DNS 維運中,我們經常會看到一些可疑查詢: 這些請求有些來自網際網路掃描,有些則是自動化偵測或 Bot 行為。其中 wpad(Web Proxy Auto Discovery)甚至可能被用於安全攻擊(WPAD 攻擊)。 若我們希望: 就可以透過「共用 Sinkhole Zone」的方式實作。 二、共用 Sinkhole Zone 設定範例 1️⃣ 建立共用區檔 檔名: 內容: 2️⃣ 在 named.conf 中引用 多個 zone 可共用同一個檔案: 這樣不論你要沉沒幾個子域,都可共用一份檔案,維護最簡單。 三、DNSSEC 的關聯與注意事項 DNSSEC 採用「信任鏈」的驗證機制。每一層的關係是: 這條鏈由 DS record(Delegation Signer)串起。 ✅ 若主域有 DNSSEC(如 nuface.tw) 你在 ISP / Registry…
Building a Linux Gateway with HTB + iptables + IFB
Complete Bidirectional Bandwidth Control (Web / Mail / FTP / VoIP) In this article, we’ll build a Linux-based gateway that not only routes traffic between your LAN and the Internet but also provides precise QoS and bandwidth shaping using HTB, iptables, and IFB. This setup is ideal for small offices, labs, or home networks where…
Linux Gateway 上的 HTB 雙向頻寬控制實作
一、環境設定 介面 方向 說明 eth0 外網(WAN) 連接 Internet(例如 PPPoE、NAT 出口) eth1 內網(LAN) 內部使用者連線的網卡,例如 192.168.10.0/24 Gateway Linux 主機 同時負責路由與 NAT 目標 控制內部使用者上 / 下行頻寬與分類(Web/Mail/FTP/VoIP) 二、邏輯說明 流量方向定義: 類型 封包方向 實際控制介面 上傳 LAN → WAN 控制 eth0 的 egress 下載 WAN → LAN 控制 eth1 的 ingress(轉發前)→ 用 IFB 重導再整形 因此: 重點:雖然下載的流量「進入 eth0」再被轉送到 eth1,但我們控制的是「eth0 的 ingress」,不是 eth1 的…
How to Properly Configure robots.txt and Sitemap in WordPress (Using SureRank as an Example)
In the world of SEO optimization, two small files often make a big difference: robots.txt and sitemap.xml.Although simple, they play a crucial role in determining whether search engines can successfully crawl and index your website. This article uses a real-world example — https://www.nuface.tw/, running WordPress 6.8.3 with the SureRank SEO Plugin — to explain how…
如何正確設定 WordPress 的 robots.txt 與 Sitemap(以 SureRank 為例)
在網站 SEO 優化的過程中,常聽到兩個關鍵字:robots.txt 與 sitemap.xml。這兩個檔案雖然簡單,卻是影響搜尋引擎能否順利索引網站內容的重要關鍵。本文以實際案例(網站:https://www.nuface.tw/、使用 WordPress 6.8.3 + SureRank SEO Plugin)說明設定方式與常見錯誤排除方法。 一、robots.txt 是什麼? robots.txt 是放在網站根目錄下的文字檔,用來告訴搜尋引擎哪些內容可以被爬取(crawl),哪些不行。這個檔案不會影響網站運作,但會影響 Google、Bing 等搜尋引擎的收錄行為。 📂 位置: 🧱 功能: 二、WordPress 建議版 robots.txt 若你的網站使用 WordPress(例如 SureRank、Yoast、Rank Math 等 SEO 外掛),建議使用以下設定: 三、SureRank Sitemap 設定說明 SureRank 會自動產生一個「索引型 Sitemap(sitemap index)」:👉 https://www.nuface.tw/sitemap_index.xml 此檔案內包含多個子 sitemap,例如: 搜尋引擎只需讀取最上層的 sitemap_index.xml,即可自動遞迴讀取下層 sitemap,因此在 robots.txt 中只需列出一行即可。 四、常見錯誤:首頁無法被索引(Homepage not indexable) 在 SureRank 的 Site Analysis 中,有時會看到如下警示訊息:…