Skip to content

Nuface Blog

隨意隨手記 Casual Notes

Menu
  • Home
  • About
  • Services
  • Blog
  • Contact
  • Privacy Policy
  • Login
Menu

Category: DNS

About DNS

Understanding Unbound DNS in OPNsense — Function, Principles, and Integration with BIND9

Posted on 2025-11-102025-11-10 by Rico

🧠 1. What is Unbound DNS? Unbound is a DNS Resolver developed by NLnet Labs.It’s designed to resolve domain names for internal users — that is, to find the real IP address of a domain such as www.google.com. Unlike BIND9, which is commonly used as an Authoritative DNS server to host your company’s domain records,…

Read more

OPNsense 的 Unbound DNS — 功用、原理與與 BIND9 共存方式

Posted on 2025-11-102025-11-10 by Rico

🧠 一、Unbound 是什麼? Unbound 是一個由 NLnet Labs 開發的 DNS Resolver(遞迴式 DNS 伺服器),主要功能是: 幫內部用戶端「查詢網域名稱的真實 IP 位址」。 它不是用來「託管網域」的,而是用來 轉譯查詢(Resolve)使用者輸入的網址,例如: 所以它的角色類似於: ⚙️ 二、Unbound 的主要功能與特色 功能項目 說明 DNS Resolver(遞迴查詢) 自行從根伺服器層層解析,不依賴外部 DNS。 DNS Forwarder(轉遞模式) 可設定轉發至指定 DNS(例如 8.8.8.8、1.1.1.1 或你的 BIND9)。 DNS-over-TLS (DoT) 支援加密 DNS 查詢,提升隱私性。 DNS Rebind Protection 防止惡意網域解析回內網 IP(常見攻擊手法)。 Blocklist / Override 可封鎖廣告網域、內網覆寫特定域名(例如將 mail.company.com 指向內部 IP)。 DHCP 整合 可自動註冊內網 DHCP…

Read more

Before Building Your Mail Server: Understanding DNS & SNI Configuration

Posted on 2025-11-072025-11-07 by Rico

Before diving into setting up your own mail server, it’s essential to understand the DNS and TLS foundations that make email delivery secure and trustworthy.This article explains the DNS records your mail system depends on and how SNI (Server Name Indication) works in both Postfix and Dovecot. 1. Why DNS Configuration Matters for Mail Servers…

Read more

在建立 Mail Server 前,必須了解的 DNS 與 SNI 設定觀念

Posted on 2025-11-072025-11-07 by Rico

一、為什麼在架設 Mail Server 前要先處理 DNS? 電子郵件的收發行為是建立在 DNS 上的。無論是外部寄信給你,還是你寄信出去,DNS 都扮演「郵局導航系統」的角色。主要涉及四項紀錄: 記錄類型 功能 範例 MX (Mail Exchanger) 告訴全世界你的郵件要送到哪一台伺服器 example.com. MX 10 mail.example.com. SPF (Sender Policy Framework) 說明哪些主機有權代表你的網域寄信 v=spf1 ip4:1.2.3.4 include:_spf.google.com -all DMARC (Domain-based Message Authentication, Reporting and Conformance) SPF、DKIM 驗證結果的策略規範與報告 v=DMARC1; p=quarantine; rua=mailto:dmarc-report@example.com DKIM (DomainKeys Identified Mail) 利用簽章機制驗證郵件內容是否被竄改 在 DNS 上建立 default._domainkey.example.com TXT 💡 實際建議: 二、Postfix 的…

Read more

How Docker Containers Communicate Using Container Names

Posted on 2025-11-06 by Rico

When running multiple Docker containers, one common question is:“Can containers connect to each other using their container names?”The answer is Yes!But — only if they are on the same custom Docker network. 1. Why the Default Network Doesn’t Work By default, Docker creates a bridge network (also known as docker0).However, this default bridge network does…

Read more

Docker 不同容器間如何透過容器名互相連線

Posted on 2025-11-062025-11-06 by Rico

在使用 Docker 建立多個服務容器時,常常會遇到一個問題:「不同容器之間能不能用容器名稱互相連線?」答案是 —— 可以的!但前提是:它們必須在同一個自訂的 Docker network 裡。 一、為什麼預設 network 不行? Docker 預設會建立一個名為 bridge 的網路(也就是 docker0)。這個預設網路不提供容器名的 DNS 解析,因此容器之間只能用 IP 位址互相連線。 這樣做在測試階段還可以,但在實際環境中,容器 IP 經常變動,維護起來相當麻煩。 二、建立自訂 network 要讓容器之間能用「容器名稱」互相連線,最簡單的方法就是建立一個自訂的 network。 建立好之後,所有加入這個 network 的容器,就能彼此透過名稱解析進行通訊。 三、讓容器加入同一個 network 啟動容器時指定 network 參數: 此時,web 與 app 這兩個容器都在 mynet 網路裡。 四、容器之間用名稱連線 進入其中一個容器(例如 app): 測試連線: Docker 的內建 DNS 會自動解析 web → web 容器的 IP。因此你不需要知道 IP…

Read more

Understanding “network unreachable resolving ‘./NS/IN’” Messages in BIND9

Posted on 2025-11-052025-11-05 by Rico

When managing a DNS server such as BIND9, you might notice repeated messages like these in your lame-servers.log or system log: At first glance, these may look like DNS errors.In reality, they are harmless IPv6 connectivity warnings, not signs of malfunction. 🔍 Why These Messages Appear When BIND performs recursive queries, it tries to contact…

Read more

BIND9 日誌出現「network unreachable resolving ‘./NS/IN’」的原因與解決方式

Posted on 2025-11-052025-11-05 by Rico

在管理 DNS 伺服器(如 BIND9)時,有時會在 lame-servers.log 或一般系統日誌中看到如下訊息: 乍看之下像是 DNS 出錯,但其實這些只是 IPv6 無法連線的提醒訊息,並不影響實際解析。 🔍 為什麼會出現這些訊息? BIND 在進行遞迴查詢時,會同時嘗試向根伺服器(Root DNS)查詢 IPv4 與 IPv6。如果你的伺服器或 Docker 容器 沒有啟用 IPv6 網路或沒有預設 IPv6 路由,BIND 嘗試連線到 IPv6 根伺服器(如 2001:500:1::53)時,就會出現: 👉 也就是說,它只是告訴你「IPv6 不通」,並不代表 DNS 功能異常。IPv4 解析仍然正常進行。 ✅ 解決方式(擇一) 方案 A:讓 BIND 僅使用 IPv4(最簡單) 如果你的環境暫時不使用 IPv6,可讓 BIND 啟動時加上 -4 參數。 範例:你原本的啟動腳本為 其中的 -4 位置錯了,應該改成放在 映像名稱之後,如下: 這樣…

Read more

Setting Up DNSSEC from Scratch: Building a Secure DNS Zone

Posted on 2025-11-052025-11-05 by Rico

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)…

Read more

從零開始設定 DNSSEC:打造安全的 DNS Zone

Posted on 2025-11-052025-11-05 by Rico

在 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 讓它執行自動簽章:…

Read more

Posts pagination

  • 1
  • 2
  • Next

Recent Posts

  • Postfix + Let’s Encrypt + BIND9 + DANE Fully Automated TLSA Update Guide
  • Postfix + Let’s Encrypt + BIND9 + DANE TLSA 指紋自動更新完整教學
  • Deploying DANE in Postfix
  • 如何在 Postfix 中部署 DANE
  • DANE: DNSSEC-Based TLS Protection

Recent Comments

  1. Building a Complete Enterprise-Grade Mail System (Overview) - Nuface Blog on High Availability Architecture, Failover, GeoDNS, Monitoring, and Email Abuse Automation (SOAR)
  2. Building a Complete Enterprise-Grade Mail System (Overview) - Nuface Blog on MariaDB + PostfixAdmin: The Core of Virtual Domain & Mailbox Management
  3. Building a Complete Enterprise-Grade Mail System (Overview) - Nuface Blog on Daily Operations, Monitoring, and Performance Tuning for an Enterprise Mail System
  4. Building a Complete Enterprise-Grade Mail System (Overview) - Nuface Blog on Final Chapter: Complete Troubleshooting Guide & Frequently Asked Questions (FAQ)
  5. Building a Complete Enterprise-Grade Mail System (Overview) - Nuface Blog on Network Architecture, DNS Configuration, TLS Design, and Postfix/Dovecot SNI Explained

Archives

  • December 2025
  • November 2025
  • October 2025

Categories

  • AI
  • Apache
  • Cybersecurity
  • Database
  • DNS
  • Docker
  • Fail2Ban
  • FileSystem
  • Firewall
  • Linux
  • LLM
  • Mail
  • N8N
  • OpenLdap
  • OPNsense
  • PHP
  • QoS
  • Samba
  • Switch
  • Virtualization
  • VPN
  • WordPress
© 2025 Nuface Blog | Powered by Superbs Personal Blog theme