Categories: TutorialsUbuntu

Host Command in Linux

Introduction

The host command in Linux allows the user to lookup DNS (Domain Name System). It can be understood simply that you can search for the IP address of a specific domain name or you can rely on an IP address to find a specific domain name.

This is a useful command because you can rely on options to find more specific details of the domain name. Now we’re gonna guide you about using the host command in Linux. Hope you understand.

The syntax of the host command

The syntax:

host [-aCdlriTWV] [-c class] [-N ndots] [-t type] [-W time]
[-R number] [-m flag] hostname [server]

Options

Sponsored

1. Without option

$ host

Output:

2. host domain_name: print out the IP address of the domain

For example, I check the IP of google.com:

$ host google.com

Output:

3. host ip: print out domain of the IP address

Sponsored

For example:

$ host 127.0.0.1

Output:

4. -a: specify the query type

For example:

$ host -a google.com

Output:

Conclusion

And we guided you on how to use the host command in Linux.

Thank you for checking it out!

Ubuntu Server Admin

Recent Posts

Canonical Releases Ubuntu 25.04 Plucky Puffin

The latest interim release of Ubuntu introduces “devpacks” for popular frameworks like Spring, along with…

2 days ago

Ubuntu 25.04 (Plucky Puffin) Released

Ubuntu 25.04, codenamed “Plucky Puffin”, is here. This release continues Ubuntu’s proud tradition of integrating…

2 days ago

Extended Security Maintenance for Ubuntu 20.04 (Focal Fossa) begins May 29, 2025

Ubuntu released its 20.04 (Focal Fossa) release 5 years ago, on March 23, 2020. As…

3 days ago

Ubuntu 20.04 LTS End Of Life – activate ESM to keep your fleet of devices secure and operational

Focal Fossa will reach the End of Standard Support in May 2025, also known as…

4 days ago

Ubuntu MATE 25.04 Release Notes

Ubuntu MATE 25.04 is ready to soar! 🪽 Celebrating our 10th anniversary as an official…

4 days ago

Ubuntu Weekly Newsletter Issue 887

Welcome to the Ubuntu Weekly Newsletter, Issue 887 for the week of April 6 –…

5 days ago