Look up domain name servers
host [<flags>] name [<dns-server>]
You can use this to perform simple DNS
lookups. This most
usefull when wanting to convert names to IP
addresses and
vice versa
name
: Is the domain name to be look up- It can also be an IPv4 or IPv6 (colon delimited) addres in which case it will perform a reverse lookup
dns-server
: Can be either be the name ofr IP adress of thedns
server that it should query instead of the server or servers listed in/etc/resolv.conf
It serves as a simple alternative to the much feature rich command dig
You can use the -t
flag specified with the mx
field
to get the associated mx
records of a dns
name
If there is more than one they will come with a number that tells their priority, a lower number indicates a higher priority
host -t mx <name>
# <name> mail is handled by 10 <record-name>
# <name> mail is handled by 20 <record-name>