286

Is there a linux shell command that I can use to inspect the TXT records of a domain?

learningtech
  • 7,769

2 Answers2

385

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,830
108

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).

asjo
  • 1,318