如何列出所有 DNS 记录? [英] How can I list ALL DNS records?

查看:19
本文介绍了如何列出所有 DNS 记录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么办法可以列出域的所有 DNS 记录?

Is there any way I can list ALL DNS records for a domain?

我知道诸如 dig 和 nslookup 之类的东西,但它们只到此为止.例如,如果我有一个子域 A 记录为

I know about such things as dig and nslookup but they only go so far. For example, if I've got a subdomain A record as

test A somedomain.co.uk

那么除非我特别要求,例如.

then unless I specifically ask for it, eg.

dig any test.somedomain.co.uk

我看不到.

有什么方法(除了去 DNS 管理器查看记录之外)可以准确查看所有 DNS 记录是什么?

Is there any way (other than looking at the records by going to the DNS manager) to see exactly what all the DNS records are?

推荐答案

当您查询 ANY 时,您将获得该级别但不低于该级别的所有记录的列表.

When you query for ANY you will get a list of all records at that level but not below.

# try this
dig google.com any

如果域名恰好是google.com",这可能会返回 A 记录、TXT 记录、NS 记录、MX 记录等.但是,它不会返回子记录(例如,www.google.com).更准确地说,如果这些记录存在,您可能会得到这些记录.如果名称服务器选择不这样做(例如,减少响应的大小),则它不必返回这些记录.

This may return A records, TXT records, NS records, MX records, etc if the domain name is exactly "google.com". However, it will not return child records (e.g., www.google.com). More precisely, you MAY get these records if they exist. The name server does not have to return these records if it chooses not to do so (for example, to reduce the size of the response).

AXFR 是区域传输,很可能正是您想要的.但是,除非您控制该区域,否则这些通常是受限制的并且不可用.您通常会直接从权威服务器(下面的 @ns1.google.com)进行区域传输,而且通常从可能未发布的名称服务器(隐身名称服务器)进行.

An AXFR is a zone transfer and is likely what you want. However, these are typically restricted and not available unless you control the zone. You'll usually conduct a zone transfer directly from the authoritative server (the @ns1.google.com below) and often from a name server that may not be published (a stealth name server).

# This will return "Transfer failed"
dig @ns1.google.com google.com axfr

如果您可以控制该区域,则可以将其设置为获得受 TSIG 密钥保护的传输.这是客户端可以发送到服务器以授权传输的共享密钥.

If you have control of the zone, you can set it up to get transfers that are protected with a TSIG key. This is a shared secret the the client can send to the server to authorize the transfer.

这篇关于如何列出所有 DNS 记录?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆