host - DNS lookup utility

host is a simple utility for performing DNS lookups. It is normally used to convert names to IP addresses and vice versa. When no arguments or options are given, host prints a short summary of its command line arguments and options.
Sample Output has address has address has address mail is handled by 10 mail is handled by 10 mail is handled by 10 mail is handled by 10

By: tommaso
2009-03-24 16:25:12

These Might Interest You

  • Performs a reverse DNS lookup, variants include: nslookup or: host Show Sample Output

    dig -x
    postrational · 2009-09-28 15:13:34 0
  • mtr is a network utility that combines traceroute and ping utility

    mtr -c 50 -r
    ohe · 2015-08-05 07:18:52 1
  • host -i `echo $SSH_CLIENT | cut -f 1 -d \ ` | sed 's/.* domain name pointer \(.*\)\./\1/' to reverse lookup and get the hostname.

    echo $SSH_CLIENT | cut -f 1 -d ' '
    infinull · 2011-01-11 10:20:45 1
  • Short and concise output appropiate for scripts. Show Sample Output

    getent hosts <host>
    lulingar · 2014-08-19 13:54:56 0
  • From the man page. lft ? display the route packets take to a network host/socket using one of several layer-4 protocols and methods; optionally show heuristic network information in transitu -A Enable lookup and display of of AS (autonomous system) numbers (e.g., [1]). This option queries one of several whois servers (see options 'C' and 'r') in order to ascertain the origin ASN of the IP address in question. By default, LFT uses the pWhoIs service whose ASN data tends to be more accurate and more timely than using the RADB as it is derived from the Internet's global routing table. -N Enable lookup and display of network or AS names (e.g., [GNTY-NETBLK-4]). This option queries Prefix WhoIs, RIPE NCC, or the RADB (as requested). In the case of Prefix WhoIs or RADB, the network name is displayed. In the case of RIPE NCC, the AS name is displayed. Show Sample Output

    lft -NAS
    tulio · 2011-04-04 03:07:00 0

  • 0
    dig +short -x
    encoded · 2014-08-07 20:42:50 0

What Others Think

DNSpyder · 478 weeks and 1 day ago
DNSpyder · 478 weeks and 1 day ago
P17 · 478 weeks and 1 day ago
the host command returns the mx record...
defan21 · 477 weeks and 3 days ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this? is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands

Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.


Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: