I'm trying to construct a script that will run a command using the contents of two files, and append the results of that command to another file.
My two files:
nameservers
- contains the addresses of my DNS.hostnames
- contains hostnames that needs to be resolved against the nameservers.
I need to pass the contents of nameservers
and hostnames
to this command:
dig @[content of nameservers file] -t a [content of hostnames]
Then each run it will extract the query time value and append it into a file in the following format:
[nameserver1] [query time value]
Like:
1.1.1.1 100
2.2.2.2 120
3.3.3.3 115