我的 PTR 记录有问题。
我已经配置了 DNS PTR 设置,但 MXToolbox 无法识别它们。这是怎么回事?
所有其他 DNS 设置均有效
有一些 IP 地址nslookup
无法解析(在 Windows 和 Linux 上)。
我可以找到主机名的IP,但反向查找失败。
PS C:\> nslookup.exe somehost2
Server: corpdns.mydomain.com
Address: 10.248.2.1
Name: somehost2.corp.mydomain.com
Address: 10.185.140.22
# Reverse lookup of the same IP fails:
PS C:\> nslookup.exe 10.185.140.22
Server: corpdns.mydomain.com
Address: 10.248.2.1
*** corpdns.mydomain.com can't find 10.185.140.22: Non-existent domain
但是,Resolve-DnsName
PowerShell 命令返回反向查找的主机名。
PS C:\> Resolve-DnsName 10.185.140.22
Name Type TTL Section NameHost
---- ---- --- ------- --------
22.140.185.10.in-addr.arpa. PTR 1200 Question somehost2
我在这里观察到两件不寻常的事情:
对于其他 IP 地址(nslookup
可以解析),我们看到它来自Answer部分并带有 DNS 域。
PS C:\> Resolve-DnsName 10.210.0.127
Name Type TTL Section NameHost
---- ---- --- ------- --------
127.0.210.10.in-addr.arpa PTR 1200 Answer somehost1.corp.mydomain.com
顺便说一句,ping
使用/a
标志也可以成功解析 Windows 上的名称:
PS C:\> ping /a 10.185.140.22
Pinging somehost2 [10.185.140.22] with 32 bytes of data:
Reply from 10.185.140.22: bytes=32 time=6ms TTL=127
Reply from 10.185.140.22: bytes=32 time=12ms TTL=127
但是我在 Linux 中找不到等效的标志ping
。
Resolve-DnsName
与有什么ping
不同nslookup
?
我的主要问题是当我尝试在 Linux 中解析 IP 时。我已经尝试了几次nslookup
并dig
命令无济于事。Resolve-DnsName
在 Linux 中有等效项吗?
大多数 IP 地址也可以解决nslookup
,问题仅出在我们环境中的特定主机子集上。
nslookup
调试模式PS C:\> nslookup.exe -d 10.185.140.22
------------
Got answer:
HEADER:
opcode = QUERY, id = 1, rcode = NOERROR
header flags: response, auth. answer, want recursion, recursion avail.
questions = 1, answers = 1, authority records = 0, additional = 0
QUESTIONS:
1.2.248.10.in-addr.arpa, type = PTR, class = IN
ANSWERS:
-> 1.2.248.10.in-addr.arpa
name = corpdns.mydomain.com
ttl = 1200 (20 mins)
------------
Server: corpdns.mydomain.com
Address: 10.248.2.1
------------
Got answer:
HEADER:
opcode = QUERY, id = 2, rcode = NXDOMAIN
header flags: response, auth. answer, want recursion, recursion avail.
questions = 1, answers = 0, authority records = 1, additional = 0
QUESTIONS:
22.140.185.10.in-addr.arpa, type = PTR, class = IN
AUTHORITY RECORDS:
-> 185.10.in-addr.arpa
ttl = 900 (15 mins)
primary name server = gdns602.corp.mydomain.com
responsible mail addr = hostmaster.mydomain.com
serial = 35869652
refresh = 300 (5 mins)
retry = 900 (15 mins)
expire = 604800 (7 days)
default TTL = 900 (15 mins)
------------
*** corpdns.mydomain.com can't find 10.185.140.22: Non-existent domain
Resolve-DnsName
当使用不同的标志时,这些系统会失败,例如:-DnsOnly
, -NoHostsFile
, -LlmnrNetbiosOnly
(但确实适用于可以解析的其他 IP 地址nslookup
)。
PS C:\> Resolve-DnsName 10.185.140.22 -DnsOnly
Resolve-DnsName : 22.140.185.10.in-addr.arpa : DNS name does not exist
At line:1 char:1
+ Resolve-DnsName 10.185.140.22 -DnsOnly
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ResourceUnavailable: (22.140.185.10.in-addr.arpa:String) [Resolve-DnsName], Win32Exception
+ FullyQualifiedErrorId : DNS_ERROR_RCODE_NAME_ERROR,Microsoft.DnsClient.Commands.ResolveDnsName
PS C:\> Resolve-DnsName 10.185.140.22 -NoHostsFile
Resolve-DnsName : 22.140.185.10.in-addr.arpa : DNS name does not exist
At line:1 char:1
+ Resolve-DnsName 10.185.140.22 -NoHostsFile
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ResourceUnavailable: (22.140.185.10.in-addr.arpa:String) [Resolve-DnsName], Win32Exception
+ FullyQualifiedErrorId : DNS_ERROR_RCODE_NAME_ERROR,Microsoft.DnsClient.Commands.ResolveDnsName
PS C:\> Resolve-DnsName 10.185.140.22 -LlmnrNetbiosOnly
Resolve-DnsName : 22.140.185.10.in-addr.arpa : DNS record does not exist
At line:1 char:1
+ Resolve-DnsName 10.185.140.22 -LlmnrNetbiosOnly
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ResourceUnavailable: (22.140.185.10.in-addr.arpa:String) [Resolve-DnsName], Win32Exception
+ FullyQualifiedErrorId : RECORD_DOES_NOT_EXIST,Microsoft.DnsClient.Commands.ResolveDnsName
我们有一个预发布站点来测试 DNS(和其他服务)在变热之前。我以前从未在这里涉及公共 IP,它可能无法按我的预期工作。我们有一个来自我们的 ISP 的 /29-net 是公共 IP。121.24.124.144/29。为了测试不同“视图”的 DNS,我们设置了路由器的 LAN 端来模拟这个网络;将路由器作为我们 ISP 的 GW。除了无法从外部实际连接(当然可以通过端口转发完成),这不是这里的意图。)
拓扑:
连接到我们 ISP 的路由器通过 NAT 与我们的网络进行 dhcp 连接。LAN IP 设置为 121.24.124.145/29 (这是我们自己的 IP 网络,因此此时不应从外部连接)它应该(并且确实)在本地世界中作为囚犯工作。暂且。
我们的 DNS 连接的路由器(谢尔比)的 WAN IP 为 121.24.124.146 和 LAN 192.168.13.1。DNS 服务器 (emma) 位于 192.168.13.2。
> dig -x 121.24.124.146 @192.168.13.2
结果是:
;; ANSWER SECTION:
146.124.24.121.in-addr.arpa. 86400 IN PTR static-121-24-124-146.cust.com.
;; AUTHORITY SECTION:
124.24.121.in-addr.arpa. 77013 IN NS o.dns.cust.com.
124.24.121.in-addr.arpa. 77013 IN NS f.dns.cust.com.
;; ADDITIONAL SECTION:
f.dns.cust.com. 76895 IN A 19.71.22.3
o.dns.cust.com. 77013 IN A 19.71.18.5
(此时是 IP 地址的当前所有者(ISP))
我假设我们的 dns 会回复
;; ANSWER SECTION:
146.124.24.121.in-addr.arpa. 86400 IN PTR fw-shelby.energia.com.
使用正确的 IP/FQDN 进行反向查找时,任何其他本地主机都会按预期工作。转发地址工作正常。
> dig fw-shelby.energia.com
;; ANSWER SECTION:
fw-shelby.energia.com. 10800 IN CNAME shelby.energia.com.
shelby.energia.com. 10800 IN A 121.24.124.146
;; AUTHORITY SECTION:
energia.com. 10800 IN NS emma.energia.com.
;; ADDITIONAL SECTION:
emma.energia.com. 10800 IN A 192.168.13.1
这个结果引发了一些问题。
受影响的文件:
/etc/bind/zonefiles/public/named.reverse.zone.conf
zone "144.124.24.121.in-addr.arpa"
{
type master;
file "/etc/bind/zonefiles/public/reverse-144.124.24.121.zone";
allow-update { none; };
};
; /etc/bind/zonefiles/public/reverse-144.124.24.121.zone
; 121.24.124.144 (-121.24.124.151)
$ORIGIN 144.124.24.121.in-addr.arpa.
$TTL 345600
@ IN SOA emma.energia.com. root.emma.energia.com. (
2022101102 ;Serial
86400 ;Refresh 24 hours
7200 ;Retry 2 hours
2592000 ;Expire 30 days
345600 ) ;Minimum 4 days
IN NS emma.energia.com.
145 IN PTR gw-isp.energia.com.
146 IN PTR shelby.energia.com.
147 IN PTR shelley.energia.com.
148 IN PTR mailis.energia.com.
149 IN PTR ava.energia.com.
150 IN PTR www.energia.com.
我检查了将区域设置为 $ORIGIN 124.24.121.in-addr.arpa。只是为了排除反向区域可能不允许这么“小”。但是不,没有区别。
至于参考:
; Bind reverse hosts
$ORIGIN 13.168.192.in-addr.arpa.
$TTL 345600
@ IN SOA emma.energia.com. root.emma.energia.com. (
1998030900 ;Serial
86400 ;Refresh 24 hours
7200 ;Retry 2 hours
2592000 ;Expire 30 days
345600 ) ;Minimum 4 days
IN NS emma.energia.com.
1 IN PTR gw-shelby.energia.com.
2 IN PTR emma.energia.com.
3 IN PTR gw-rivendale-link-br.energia.com.
4 IN PTR unused-ip-rd4.energia.com.
正向和反向都可以正常工作。我没有提交任何其他命名的配置文件,因为其余的工作和日志确认区域已加载。但如果需要请询问!
出现我们自己的反向名称会不那么令人沮丧。ISP 的反向名称只会令人困惑。
我发现了几个与此相关的线程,但它们都非常过时,所以我想澄清一下。
我使用带有弹性 IP 的 AWS ec2 实例,我在 ubuntu 18.04 上使用后缀设置了一个 SMTP(仅发送)邮件服务器,并通过 domain.google 管理我的 DNS。我正在设置我所有的 MX、SPF、dmarc/dkim 记录,但我对如何设置 PTR 记录感到困惑。
当我选择“PTR”时,它会要求提供主机名和数据字段。这是我的困惑:
PTR 记录被认为是反向 DNS 不是吗?它不应该是指向我的 smtp.mydomain.com 的 IP 地址吗?当我在主机名字段中键入 IP 地址时,它会附加 .mydomain.com,因此它看起来像:
###.###.###.###.mydomain.com -> smtp.mydomain.com
不应该只是:
###.###.###.### -> smtp.mydomain.com?
我们在公司的单一静态 IP 地址 (mail.companyA.com) 上有一个自托管邮件服务器。我们的网站由另一家公司在不同的 IP 地址 (companyA.com) 托管。我们的电子邮件使用@companyA.com 域。
有时我们会向某些顺利通过的客户发送电子邮件,有时我们会收到来自同一个客户的退回,表明我们被阻止了。简短的故事:我担心一些对电子邮件有更严格要求的公司进行的反向 DNS 查找会给我们带来麻烦,具体取决于首先出现的 rDNS 查找结果。
MXToolbox 报告说,对我们的静态 IP 地址(我们从中发送电子邮件)的 rDNS 查找有两个 PTR 记录:一个到 mail.companyA.com,另一个到 companyA.com
我应该要求我们的 ISP 删除 companyA.com 的 PTR 记录,只留下 mail.companyA.com - 还是会产生问题?
我的问题与这个问题相同,但接受的答案和评论并没有帮助我解决我的问题。我将把我拥有的整个设置放在这里。
BIND9 版本 - BIND 9.11.5-P4-5.1+deb10u6-Debian (Extended Support Version)
,
操作系统 -Debian Buster (10.11)
named.conf
:
// This is the primary configuration file for the BIND DNS server named.
//
// Please read /usr/share/doc/bind9/README.Debian.gz for information on the
// structure of BIND configuration files in Debian, *BEFORE* you customize
// this configuration file.
//
// If you are just adding zones, please do that in /etc/bind/named.conf.local
include "/etc/bind/named.conf.options";
include "/etc/bind/named.conf.local";
include "/etc/bind/named.conf.default-zones";
named.conf.options
:
options {
directory "/var/cache/bind";
// If there is a firewall between you and nameservers you want
// to talk to, you may need to fix the firewall to allow multiple
// ports to talk. See http://www.kb.cert.org/vuls/id/800113
// If your ISP provided one or more IP addresses for stable
// nameservers, you probably want to use them as forwarders.
// Uncomment the following block, and insert the addresses replacing
// the all-0's placeholder.
//forwarders {
// 0.0.0.0;
// };
//========================================================================
// If BIND logs error messages about the root key being expired,
// you will need to update your keys. See https://www.isc.org/bind-keys
//========================================================================
dnssec-validation auto;
listen-on-v6 { any; };
//hide version number from clients for security reasons.
version "not currently available";
};
named.conf.local
:
//
// Do any local configuration here
//
// Consider adding the 1918 zones here, if they are not used in your
// organization
//include "/etc/bind/zones.rfc1918";
named.conf.default-zones
:
// prime the server with knowledge of the root servers
zone "." {
type hint;
//Default
//file "/usr/share/dns/root.hints";
file "/etc/bind/db.fake.root";
};
// be authoritative for the localhost forward and reverse zones, and for
// broadcast zones as per RFC 1912
zone "localhost" {
type master;
file "/etc/bind/db.local";
};
zone "127.in-addr.arpa" {
type master;
file "/etc/bind/db.127";
};
zone "0.in-addr.arpa" {
type master;
file "/etc/bind/db.0";
};
zone "255.in-addr.arpa" {
type master;
file "/etc/bind/db.255";
};
db.fake.root
:
; BIND reverse data file for empty rfc1918 zone
;
; DO NOT EDIT THIS FILE - it is used for multiple zones.
; Instead, copy it, edit named.conf, and use that copy.
;
$TTL 86400
@ IN SOA ns. root.unimar.io. (
1 ; Serial
604800 ; Refresh
86400 ; Retry
2419200 ; Expire
86400 ) ; Negative Cache TTL
;
@ IN NS ns
ns IN A 127.0.0.1
$ORIGIN unimar.io.
uniapp IN A 10.120.0.12
当我重新启动它运行的服务时,但在日志中收到此警告消息:
Nov 25 11:03:11 unimarDNS named[1145]: zone 255.in-addr.arpa/IN: loaded serial 1
Nov 25 11:03:11 unimarDNS named[1145]: zone 127.in-addr.arpa/IN: loaded serial 1
Nov 25 11:03:11 unimarDNS named[1145]: zone localhost/IN: loaded serial 2
Nov 25 11:03:11 unimarDNS named[1145]: all zones loaded
Nov 25 11:03:11 unimarDNS systemd[1]: Started BIND Domain Name Server.
Nov 25 11:03:11 unimarDNS named[1145]: running
Nov 25 11:03:11 unimarDNS named[1145]: lame server resolving '.' (in '.'?): 127.0.0.1#53
Nov 25 11:03:11 unimarDNS named[1145]: lame server resolving '.' (in '.'?): 127.0.0.1#53
Nov 25 11:03:11 unimarDNS named[1145]: managed-keys-zone: Unable to fetch DNSKEY set '.': failure
Nov 25 11:03:11 unimarDNS named[1145]: resolver priming query complete
当我尝试dig
主机时,我得到了这个:
root@unimarDNS:/etc/bind# dig uniapp.unimar.io
; <<>> DiG 9.11.5-P4-5.1+deb10u6-Debian <<>> uniapp.unimar.io
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: SERVFAIL, id: 39791
;; flags: qr rd ra; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1
;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
; COOKIE: 8da51eb1b4443aeda9f03e38619f5190efb0dc3cd3c88f68 (good)
;; QUESTION SECTION:
;uniapp.unimar.io. IN A
;; Query time: 1 msec
;; SERVER: 10.120.0.13#53(10.120.0.13)
;; WHEN: Thu Nov 25 11:04:16 EET 2021
;; MSG SIZE rcvd: 73
在日志中我得到了这个:
Nov 25 11:04:16 unimarDNS named[1145]: lame server resolving '0.debian.pool.ntp.org' (in '.'?): 127.0.0.1#53
Nov 25 11:04:16 unimarDNS named[1145]: lame server resolving '0.debian.pool.ntp.org' (in '.'?): 127.0.0.1#53
Nov 25 11:04:16 unimarDNS named[1145]: lame server resolving '1.debian.pool.ntp.org' (in '.'?): 127.0.0.1#53
Nov 25 11:04:16 unimarDNS named[1145]: lame server resolving '1.debian.pool.ntp.org' (in '.'?): 127.0.0.1#53
Nov 25 11:04:16 unimarDNS named[1145]: lame server resolving '2.debian.pool.ntp.org' (in '.'?): 127.0.0.1#53
Nov 25 11:04:16 unimarDNS named[1145]: lame server resolving '2.debian.pool.ntp.org' (in '.'?): 127.0.0.1#53
Nov 25 11:04:16 unimarDNS named[1145]: lame server resolving '3.debian.pool.ntp.org' (in '.'?): 127.0.0.1#53
Nov 25 11:04:16 unimarDNS named[1145]: lame server resolving '3.debian.pool.ntp.org' (in '.'?): 127.0.0.1#53
请问谁能告诉我我做错了什么?
编辑
我确实喜欢下面评论中建议的@Nikita Kipriyanov。
该问题中的解决方案不起作用,因为 BIND 期望对根区域进行签名。我不明白为什么要尝试重新定义根服务器,而不仅仅是为所需区域制作授权服务器?这是非常不必要的并发症。如果系统与 Internet 断开连接,则 Internet 查找无论如何都会失败。
我正在寻找一种方法来过滤wireshark中的数据包捕获,以应对我们的服务器以“拒绝”响应递归DNS查询的情况。
dns.resp.type==
似乎没有提供任何我认为与我的要求相匹配的东西,我是否需要完全看下其他地方dns.resp
?
我有一个具有单个 IP 地址和多个域名的 VPS。
我使用 mail-tester.com 来检查我的电子邮件的垃圾邮件率。我的结果是:
Your IP address 93.123.12.43 is associated with the domain 2132217.myisp.net.
Nevertheless your message appears to be sent from mail.example.com.
You may want to change your pointer (PTR type) DNS record and the host name of your server to the same value.
Here are the tested values for this check:
IP: 93.123.12.43
HELO: mail.example.com
rDNS: 2132217.myisp.net
现在,当我在 ISP 的托管面板中检查我的 VPS 的 DNS 反向设置时,我看到 IP 93.123.12.43 的 2132217.myisp.net。我知道我不能将多个域名与一个 IP 地址相关联,所以:
我是否应该将“2132217.myisp.net”替换为 MAIL 服务器域“mail.example.com”作为 FQDN?
(我不确定 rDNS 设置是否用于电子邮件以外的其他用途,更改此设置可能会破坏我的网站)。
我已经在这里检查过: 共享 IP 地址上多个域的 PTR 记录 (rDNS)
我正在使用 Kathara(类似于 Netkit)模拟一个网络,但我无法弄清楚如何让反向 DNS 在所有三个网络中工作。
我确实设法让递归查找工作。当查询一个不在其数据库中的名称时,ns.as1.net 将查询 nsroot,然后沿着层次结构向下,最终从权威服务器获得响应。我通过添加一个带有 nsroot 地址记录的 db.root 文件并将其用于区域“。”来做到这一点。
命名的.conf:
[...]
zone "." {
type hint;
file "/etc/bind/db.root";
};
[...]
db.root:
. IN NS ROOT-SERVER.
ROOT-SERVER. IN A 1.1.2.2
我的问题是:如何让反向 DNS 以相同的方式工作?
我只能通过配置zone "3.3.in-addr.arpa"
on使其在本地工作ns.as3.net
,但这样,它只适用于将 ns.as3.net 设置为解析器的主机。
AS3中的地铁:
My traceroute [v0.93]
c2as3 (3.3.2.2) 2021-06-29T02:11:52+0000
Keys: Help Display mode Restart statistics Order of fields quit
Packets Pings
Host Loss% Snt Last Avg Best Wrst StDev
1. r33.as3.net (3.3.2.1) 0.0% 12 0.1 0.1 0.1 0.2 0.0
2. r32.as3.net (3.3.1.13) 0.0% 12 0.1 0.2 0.1 0.3 0.0
3. ns.as3.net (3.3.4.2) 0.0% 11 0.2 0.2 0.2 0.2 0.0
从 AS2 到 AS3 的地铁:
My traceroute [v0.93]
c1as2 (2.2.2.2) 2021-06-29T02:14:22+0000
Keys: Help Display mode Restart statistics Order of fields quit
Packets Pings
Host Loss% Snt Last Avg Best Wrst StDev
1. 2.2.2.1 (2.2.2.1) 0.0% 7 0.1 0.1 0.1 0.2 0.0
2. 2.2.1.9 (2.2.1.9) 0.0% 6 0.1 0.1 0.1 0.1 0.0
3. 2.2.0.2 (2.2.0.2) 0.0% 6 0.2 0.1 0.1 0.2 0.0
4. 3.3.1.6 (3.3.1.6) 0.0% 6 0.2 0.2 0.2 0.2 0.0
5. 3.3.4.2 (3.3.4.2) 0.0% 6 0.2 0.2 0.2 0.3 0.0
我确实考虑过在所有名称服务器中添加每个 arpa 区域,但我认为这不是正确的方法。
我将非常感谢提供的任何提示或帮助。
我尝试使用谷歌公共 DNS 来解析我尝试 36032b.cc 的 DNS 记录。下面是结果,但有人可以向我解释结果吗?我在互联网上找不到有关这些结果的任何指南。状态:0 是什么意思?什么是 TC、RD、RA、AD。为什么我有多个答案?
{
"Status": 0,
"TC": false,
"RD": true,
"RA": true,
"AD": false,
"CD": false,
"Question": [
{
"name": "36032b.cc.",
"type": 1
}
],
"Answer": [
{
"name": "36032b.cc.",
"type": 5,
"TTL": 299,
"data": "982020.ssl-cdnweb.net."
},
{
"name": "982020.ssl-cdnweb.net.",
"type": 1,
"TTL": 299,
"data": "18.140.5.212"
},
{
"name": "982020.ssl-cdnweb.net.",
"type": 1,
"TTL": 299,
"data": "139.99.120.10"
}
],
"Additional": [],
"Comment": "Response from 159.138.76.159."
}