我尝试将 DNS 查询转发到 Google DNS,但没有成功。以下是我的/etc/mararc
文件内容:
csv2 = {}
csv2["example.net."] = "db.example.net"
csv2["google.com."] = "db.google.com"
ipv4_bind_addresses = "127.0.0.1"
chroot_dir = "/etc/maradns"
recursive_acl = "127.0.0.1/16"
upstream_servers = {}
upstream_servers["."] = "8.8.8.8"
当我通过 检查gmail.com
DNS 解析时nslookup
,我得到:
> server 127.0.0.1
Default server: 127.0.0.1
Address: 127.0.0.1#53
> gmail.com
;; connection timed out; trying next origin
;; connection timed out; no servers could be reached
我已允许来自iptables
以下来源的传出 DNS 查询:
iptables -A OUTPUT -p udp --dport 53 -j ACCEPT
有什么指点吗?
答案1
以下解决方案对我有用。我必须使用 MaraDNS Deadwood 来转发 DNS 查询。以下是内容/etc/dwood3rc
:
bind_address="127.0.0.1" # IP we bind to
chroot_dir = "/etc/maradns" # Directory we run program from (not used in Win32)
recursive_acl = "127.0.0.1/16"
upstream_servers = {}
upstream_servers["."] = "8.8.8.8, 8.8.4.4"
maxprocs = 8 # Maximum number of pending requests
handle_overload = 1 # Send SERVER FAIL when overloaded
maradns_uid = 99 # UID Deadwood runs as
maradns_gid = 99 # GID Deadwood runs as
maximum_cache_elements = 60000
cache_file = "dw_cache"
resurrections = 1
/etc/mararc
这是我的文件的内容:
csv2 = {}
csv2["example.net."] = "db.example.net" #Sample Record, just to try
csv2["google.com."] = "db.google.com" #Sample Record, just to try
ipv4_bind_addresses = "127.0.0.1"
chroot_dir = "/etc/maradns"
然后重新启动两个服务,如下所示:
service maradns.deadwood restart
service maradns restart
希望它能帮助到别人!