How to use nslookup command to check email domains in linux

3.7k Views Asked by At

How to use nslookup command to check email domains in fedora Linux? I used the following command in terminal:

nslookup -query=mx [email protected]

This is not working for me. What's the correct command?

1

There are 1 best solutions below

0
On BEST ANSWER

You can query for the domain part, not the full email address.

nslookup -query=mx dcs.ruh.ac.lk

For programmatic use, dig +short or some versions of host have better, machine-readable output than nslookup.

Not all domains supply an explicit MX record; fall back to the A record in that case (i.e. attempt to connect directly to the host).