1

I have a text file with 1.txt with the following set of domains

adrive.com
amazon.com
amazon.ca
amazon.cn
amazon.co.jp
amazon.co.uk
amazon.com.au
amazon.com.br
amazon.com.mx
amazon.de
amazon.es
amazon.fr
amazon.in
amazon.it
console.aws.amazon.com

I did the following command to get the TXT record of a domain

dig TXT 1.txt 

I am not sure,How to do this ?

Arun
  • 1,160
  • 3
  • 17
  • 33

1 Answers1

3

If you want to call dig TXT on each record of your file, you may want to use this command:

 cat 1.txt | xargs dig TXT

As stated in the xargs man:

xargs reads items from the standard input, delimited by blanks (which can be protected with double or single quotes or a backslash) or newlines, and executes the command.

Edit: I just saw that dig does have a -f option, so you can also use:

dig TXT -f 1.txt

The output of the two commands are the same.

aveuiller
  • 1,511
  • 1
  • 10
  • 25