The dig command

Can I use two different DNS servers in the one command in the form of primary and secondary.

Take this for example:
dig @<primaryAddress> @<secondaryAddress> MX domain.tld

So if primary address is down, it will use the secondary address as a backup. It seems to work when testing, but thought I'd ask around to see if there is any problems with it (since it doesn't exactly specific you can do it like this in the man pages).

Thanks.

It never occurred to me to try something like this. I have tested it and it seems to work exactly as you want. Like you, I see no explicit support for this in the man page. But it does say

which means that dig needs the ability to scan multiple name servers. So I guess your usage is ok.

1 Like