用于检查域的 TXT 记录的 Linux 命令

Joh*_*ohn 225 domain-name-system linux txt-record

是否有可用于检查域的 TXT 记录的 linux shell 命令?

Whe*_*ice 311

Dig 也会做得很好:dig -t txt example.com如果你添加了这个+short选项,你只会得到引号中的 txt 记录,而没有其他杂物。

  • @NicCottrell 和其他对此感到疑惑的人;这是因为您正在查询的域。要使用 dig 查看域密钥,它将是:`dkim-selector._domainkey.example.com` 如果 Google 是您的电子邮件提供商:`dig -t txt google._domainkey.example.com` (20认同)
  • 根据我的 DNS 经理的说法,我有 4 个 TXT 记录 - 一个带有主机“@”的 SPF 记录,然后是 3 个用于域密钥的记录。但是,``dig -t`` 仅显示 SPF 值。有任何想法吗? (9认同)

asj*_*sjo 92

所述主机(1)命令有一个很好的,简洁的输出:

$ host -t txt google.com
google.com descriptive text "v=spf1 include:_netblocks.google.com ip4:216.73.93.70/31 ip4:216.73.93.72/31 ~all"
$ wajig findfile $(which host)
bind9-host: /usr/bin/host
$ 
Run Code Online (Sandbox Code Playgroud)

使用dig(1)我“必须”一直添加“+short”选项。

(我在 Debian 上)。