dns - PowerDNS 和 CNAME 到外部域

标签 dns external cname powerdns

我正在为我的客户使用 PowerDNS (2.9.22)。因为它可以将所有数据存储到 MySQL 数据库中,并且客户可以轻松地根据需要编辑他们的区域。

现在我遇到了 CNAME 的问题:

以下是 MySQL 数据库中的记录:

+-----------------------+-------+-----------------------+
| localhost.example.com |   A   | 127.0.0.1             |
+-----------------------+-------+-----------------------+
| a.example.com         | CNAME | localhost.example.com |
+-----------------------+-------+-----------------------+
| www.example.com       | CNAME | andreyzentavr.com     |
+-----------------------+-------+-----------------------+

PowerDNS 配置在这里:
allow-recursion=127.0.0.1, 173.193.**.162, 173.193.**.163
allow-recursion-override=on
cache-ttl=20
config-dir=/etc/powerdns
daemon=yes
default-soa-name=ns3.bserver.com
disable-axfr=yes
guardian=no
launch=gmysql
gmysql-host=127.0.0.1
gmysql-port=3306
gmysql-user=powerdns
gmysql-dbname=powerdns
gmysql-password=123123
lazy-recursion=yes
local-address=173.193.**.162, 173.193.**.163
local-port=53
log-dns-details=yes
log-failed-updates=yes
logfile=/var/log/pdns.log
loglevel=6
master=yes
max-queue-length=5000
max-tcp-connections=10
module-dir=/usr/lib/powerdns
query-logging=yes
recursor=127.0.0.1:53
setgid=pdns
setuid=pdns
skip-cname=no
slave=yes
slave-cycle-interval=600
soa-minimum-ttl=3600
soa-refresh-default=10800
soa-retry-default=3600
soa-serial-offset=0
socket-dir=/var/run
use-logfile=yes
wildcards=yes
version-string=powerdns

当我在做 nslookup 查询时,我得到了这个:
server:~# nslookup
> set q=any
> server ns3.***.com
Default server: ns3.***.com
Address: 173.193.**.163#53
> a.example.com
Server:         ns3.***.com
Address:       173.193.***.163#53

a.example.com      canonical name =localhost.example.com.
Name: localhost.example.com
Address: 127.0.0.1
>
>
> www.example.com
Server:         ns3.***.com
Address:       
173.193.***.163#53

** server can't find www.example.com: NXDOMAIN

如您所见,如果 CNAME 指向 INTERNAL 记录 - 一切都会解决。但是如果它指向外部域 - 我有一个错误。

andreyzentavr.com 是现有域,指向 194.126.204.41

它是 PowerDNS 中的错误吗?还是我配置错了?

最佳答案

解决方案是将递归器放在权威服务器之前,并使用 forward-zones-recurse 指令配置递归器以将特定域转发到权威服务器。需要 3.2 版的递归。

关于dns - PowerDNS 和 CNAME 到外部域,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3488415/

相关文章:

go - 在golang中获取Cosul SRV记录

javascript - JavaScript 编译错误 : "libraryVar is not defined"

windows - node.js:在新窗口中运行外部命令

ssl - 通过 SSL 将自定义 CNAME 与 CloudFront 结合使用时出现问题

python - 为 Python 脚本更改 DNS 服务器

dns - dnsmasq 中的通配符路径?

c# - 在标签上显示首选 DNS 和备用 DNS

maven - 如何在maven中通过svn处理自己的jar

amazon-web-services - AWS Route 53 使用 boto3 列出 CNAME 记录

dns - 无法转发到 Openshift 应用程序 (CNAME)