Search code examples
linuxfedora16

How to use nslookup command to check email domains in linux


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?


Solution

  • 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).