• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

host Command Examples in Linux

by admin

host is a simple tool capable of gathering information and testing name resolution. It is installed on most Linux distributions. host is one of the simplest DNS lookup utilities. If the host command is used without any option, it prints the short summary for its argument DNS lookup.

The example of host command are shown in command line here:

# host www.example.com
# host 8.8.8.8

Syntax

The basic syntax is:

# host {domain name}

The command host {domain name} {IP address} will resolve the domain name against the DNS server specified by the IP address.

$ host www.ubuntu.org
www.example.com has address xx.xx.xx.xx
$ host yy.yy.yy.yy
yy.yy.yy.yy.in-addr.arpa domain name pointer
 example.org.

host Command Examples

1. Lookup A, AAAA, and MX records of a domain:

# host domain

2. Lookup a field (CNAME, TXT,…) of a domain:

# host -t field domain

3. Reverse lookup an IP:

# host ip_address

4. Specify an alternate DNS server to query:

# host domain 8.8.8.8

Conclusion

If the host command doesn’t do what you want, try dig, another powerful DNS lookup utility. You might also encounter the nslookup command, mostly obsolete but still found on some Linux and Unix systems.

Filed Under: Linux

Some more articles you might also be interested in …

  1. gdebi: command not found
  2. bfg Command Examples (Remove large files or passwords from Git history like git-filter-branch)
  3. How to Disable IPv6 on Ubuntu 18.04 Bionic Beaver Linux
  4. How to enable additional scsi logging in CentOS/RHEL
  5. addr2line: command not found
  6. ack – A search tool like grep, optimized for developers (Command Examples)
  7. killall: command not found
  8. lvmdiskscan Command Examples in Linux
  9. mkfs.exfat Command Examples in Linux
  10. pluma: command not found

You May Also Like

Primary Sidebar

Recent Posts

  • glab Command Examples
  • “glab repo” Command Examples
  • “glab release” Command Examples
  • “glab pipeline” Command Examples

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright