hostess
Manage hostname resolution using local files
TLDR
List domains, target IP addresses and on/off status
Add a domain pointing to your machine to your hosts file
Remove a domain from your hosts file
Disable a domain (but don't remove it)
SYNOPSIS
host [-aCdlnrTwv] [-c class] [-N ndots] [-t type] [-W timeout] [-R number of retries] [-m flag] hostname [server]
PARAMETERS
-a
Equivalent to -v -t ANY.
-c
Specifies the DNS class to query. The default is IN (Internet).
-C
Check for consistency for multiple authoritative DNS servers. Only available if host is built with libbind >= 9.5.
-d
Enable debugging output.
-l
Use ls command to list all DNS domain. This option deprecated, use dig command instead.
-N
Sets the number of dots that must be in a domain name for host to make an initial absolute query. The default value is that defined using ndots in /etc/resolv.conf (defaulting to 1 if not defined).
-r
Disable recursive query.
-t
Specifies the DNS record type to query. Examples include A, MX, NS, SOA, etc. If no type is specified, host defaults to querying for A records.
-T
Enable TCP/IP connections for DNS queries. Use TCP when querying for zone transfers (AXFR).
-v
Enable verbose output.
-W
Sets the timeout in seconds for a DNS query. The default is 5 seconds.
-R
Sets the number of retries for a DNS query. The default is 1.
hostname
The domain name or IP address to query.
server
The DNS server to query. If not specified, the system's default resolver is used.
-m
Set memory usage debugging flags.
DESCRIPTION
The host command is a simple utility for performing DNS lookups. It's commonly used to convert domain names to IP addresses and vice versa, retrieve mail exchange (MX) records, and other DNS record types. Unlike more complex tools like dig or nslookup, host provides a relatively straightforward interface for basic DNS queries. It's a valuable tool for network troubleshooting, verifying DNS configurations, and quickly checking the DNS information associated with a domain.
The host command is usually preferred for shell scripts or simple automation task. In opposite dig tool provides detailed control of DNS queries and presents output in a more script-friendly format.
The host command can be used to query specific DNS servers or to use the system's configured resolver. By default, host will use the resolver configuration specified in /etc/resolv.conf.
Note: The host command is part of the bind-utils package.
EXIT STATUS
The host command returns an exit status of 0 if the query was successful, 1 if there were errors, 2 if there were server failures, 3 if there was a syntax error, 4 if the request timed out, and 11 if there was a usage error.
HISTORY
The host command has been a standard part of Unix-like operating systems for many years, evolving alongside the growth of the Internet and the Domain Name System. It's typically included in the bind-utils package, which provides essential DNS tools. The command's basic functionality has remained consistent: to perform simple DNS lookups. However, improvements and bug fixes have been incorporated over time, particularly with respect to handling various DNS record types and security enhancements.