我正在尝试在 Windows 7 上设置 maraDNS。总之,我希望 google DNS 能够解析除内联网域中的所有内容(即区域“1”)之外的所有内容,而内联网域由内联网 DNS 服务器提供服务。
所以我添加了mararc
hide_disclaimer = "YES"
ipv4_bind_addresses = "127.0.0.1"
timestamp_type = 2
random_seed_file = "secret.txt"
upstream_servers = {}
upstream_servers["."]="8.8.8.8, 8.8.4.4" # Servers we connect to
upstream_servers["intranet.lan."]="1.2.3.4, 2.3.4.5"
upstream_servers["intra.lan."]="1.2.3.4, 2.3.4.5"
这给出了
> askmara.exe Agoogle.com.
# Querying the server with the IP 127.0.0.1
# Remote server said: REFUSED
# NS replies:
# AR replies:
然后我尝试使用“csv2”变量和文本文件
upstream_servers = {}
upstream_servers["."]="8.8.8.8, 8.8.4.4" # Servers we connect to
csv2 = {}
csv2["intranet.lan."]="db.intr.lan"
csv2["intra.lan."]="db.intr.lan"
其中文本文件“db.intr.lan”包含:
intranet.lan. NS nameserver1.intranet.lan ~
intra.lan. NS nameserver1.intranet.lan ~
但这会发出警告
Processing zone asw.zone. right now.
Filename: db.eb.txt
Warning: Authoritative NSes must be immediately after SOA
Or the first records in the zone
Otherwise, the record is ignored
Processing zone elektrobit.com. right now.
Filename: db.eb.txt
但我确实不认为在这里添加“SOA”记录是正确的方法。
我不想为我的内联网创建权威名称服务器。只想将不同的域名转发到不同的名称服务器,并且显然有一个默认 DNS 位于 Google。我该怎么做?
谢谢 那么如何
答案1
首先,我对 maraDNS 不熟悉,所以我的回答不会回答你的问题,但如果你想尝试另一种解决方案,我会尝试展示如何在受良好支持的unbound
DNS 转发器上执行此操作(特别是 maraDNS 的作者说“由于 MaraDNS 处于深度冻结状态 - 我只修复安全和其他严重错误”)
首先我们需要了解unbound
私有 IP 范围
# Only 'private-domain' and 'local-data' names are allowed to have these private addresses.
private-address: 10.0.0.0/8
private-address: 172.16.0.0/12
private-address: 192.168.0.0/16
private-address: 169.254.0.0/16
private-address: fd00::/8
private-address: fe80::/10
然后讲述unbound
本地(私人)域名
private-domain: "intra.lan."
domain-insecure: "intra.lan."
local-zone: "intra.lan." nodefault # nodefault prevent leak of query to outside
# override defaults with stub-zones
local-zone: "168.192.in-addr.arpa." nodefault
然后,我们可以将本地 DNS 查询重新路由到负责“intra.lan”上的名称解析的本地 DNS。其他任何内容都将由上游 DNS 服务器解析
forward-zone:
name: "intra.lan."
forward-addr: 192.168.xx.yy # IP address of DNS responsible for "intra.lan."
stub-zone:
name: "xx.168.192.in-addr.arpa."
stub-addr: 192.168.xx.yy
(将xx和yy替换为实际IP)