Is there a linux shell command that I can use to inspect the TXT records of a domain?
Asked
Active
Viewed 3.3e+01k times
2 Answers
362
Dig will also do it quite nicely: dig -t txt example.com and if you add the +short option you get just the txt record in quote marks with no other cruft.
WheresAlice
- 5,590
- 2
- 25
- 20
103
The host(1) command has a nice, terse output:
$ 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
$
With dig(1) I "have" to add the "+short" option all the time as well.
(I'm on Debian).
Cristian Ciupitu
- 6,432
asjo
- 1,268
-
1You can put options in a
~/.digrcfile in order to never add them on command line again. – Patrick Mevzek Jul 26 '20 at 19:16
dig -tonly shows the SPF value. Any ideas? – Nic Cottrell Sep 21 '12 at 08:17dkim-selector._domainkey.example.comIf Google was your email provider:
– Robert Brisita Apr 11 '16 at 16:02dig -t txt google._domainkey.example.comdkim-selectoris what your email server will write down on the email header, while dmarc is defined to be_dmarcprefix . – Rick Apr 26 '20 at 13:46digdoesn't show the sub-domains. You have to explicitly request that:dig some._domainkey.foobar.com txt +short– rustyMagnet May 31 '22 at 10:40