I've got a txt of a bunch of domains I need to run dig +short mx on.
I've got a script set to run the command, print it to a results.txt with:
./dig_domain_mx.sh > results.txt
Downside is, I need to be able to know which domains relate to each result, so my solution is to print the current line being read by the script, then print the dig output for the line, then add a linebreak.
I can't seem to find anything alluding to this being possible with dig commands alone, so how would I go about this within my Bash script?
Current Bash script, nothing special:
#!/bin/bash dig -f domains.txt +short mx