Start HOST Query (HOST)

The Start HOST Query (STRHOSTQRY) command, or its alias HOST, is a simple utility for performing Domain Name System (DNS) lookups. It is normally used to convert names to IP addresses and vice versa.

Restrictions:

Parameters

Keyword Description Choices Notes
HOSTNAME Query name Character value Required, Positional 1
TYPE Query type *A, *AAAA, *ANY, *AXFR, *CNAME, *MX, *NS, *PTR, *SOA, *SRV, *TXT Optional, Positional 2
CLASS Query class *IN, *CH, *HS, *ANY Optional
DMNNAMSVR Domain name server Character value, *CFG Optional
SOA Display SOA records *NO, *YES Optional
AXFR List all hosts *NO, *YES Optional
IP6INT Use IP6.INT domain *NO, *YES Optional
SETRDFLAG Recursion desired *YES, *NO Optional
PROTOCOL Network protocol *UDP, *TCP Optional
DEBUG Show debug information *NO, *YES Optional
IPVSN IP Version *ALL, *IPV4ONLY, *IPV6ONLY Optional
NBRDOTS Number of dots 0-10, 1 Optional
TIMEOUT Query timeout 1-100, 5 Optional
UDPNBRRTY UDP retry 0-100, 2 Optional
TOSTMF Output file Path name, *STDOUT Optional

Query name (HOSTNAME)

Specifies the name that you want the Domain Name System (DNS) server to look up. It can also be a dotted-decimal IPv4 address or a colon-delimited IPv6 address, in which case HOST will by default perform a reverse lookup for that address.

This is a required parameter.

domain-name
Specify a valid domain name.
internet-address
Specify a valid IPv4 or IPv6 address.

Query type (TYPE)

Specifies the type of the query. The default type is *A. The list of supported query types changes with time, and not all servers support all the types that exist. This list provides some common query types for convenience and is not a complete list. If you do not see a query type you want in this list, you can still type in a character string that represents that query type. If the type is unknown by this BIND version, the query will default to an *A query with any corresponding results.

*A
IPv4 Address record. This is the character string 'a'.
*AAAA
IPv6 address record. This is the character string 'aaaa'.
*ANY
Any resource record. This is the character string 'any'.
*AXFR
Zone transfer. This is the character string 'axfr'.
*CNAME
Canonical name record. Returns a list of aliases for the true (canonical) host name, if any exist. This is the character string 'cname'.
*MX
Mail exchange record. This is the character string 'mx'.
*NS
Name server (DNS server) information for the zone. This is the character string 'ns'.
*PTR
Pointer record. Returns a name for an IP address. This is the character string 'ptr'.
*SOA
Start of authority record. This is the character string 'soa'.
*SRV
Services location selection. This is the character string 'srv'.
*TXT
Text record. This is the character string 'txt'.

Query class (CLASS)

Specifies the protocol group of the information.

*IN
The Internet class.
*CH
The CHAOS class. The server provides some helpful diagnostic information through a number of built-in zones under the CHAOS class.
version
If your BIND server named.conf has the 'version' option configured, then you can query for it using the CHAOS class. This is the version the server should report via a query of the name 'version.bind' with type TXT, class CHAOS. The default is the real version number of this server.

HOST   HOSTNAME('version.bind')  TYPE(*TXT)  CLASS(*CH)

hostname
If your BIND server named.conf has the 'hostname' option configured, then you can query for it using the CHAOS class. This is the hostname the server should report via a query of the name 'hostname.bind' with type TXT, class CHAOS. This defaults to the hostname of the machine hosting the name server. The primary purpose of such queries is to identify which of a group of anycast servers is actually answering your queries.

STRHOSTQRY   NAME('hostname.bind')  TYPE(*TXT)  CLASS(*CH)

server-id
If your BIND server named.conf has the 'server-id' option configured, then you can query for it using the CHAOS class. This is the ID of the server should report via a query of the name 'ID.SERVER' with type TXT, class CHAOS. The primary purpose of such queries is to identify which of a group of anycast servers is actually answering your queries. The default server-id is none.

HOST   HOSTNAME('ID.SERVER')  TYPE(*TXT)  CLASS(*CH)

*HS
The MIT Athena Hesiod class. Hesiod, developed by MIT Project Athena, is an information service built upon BIND. Its intent is to furnish information about users, groups, network-accessible file systems, printcaps, and mail service throughout an installation. In other words, it holds arbitrary data stored as text strings. Queries that use the HS class retrieve data stored as TXT Resource Records. You cannot specify root servers for the Hesiod class (generally the ones at MIT) in your list of root name servers.
*ANY
Query any class. This is a wildcard query.

Domain name server (DMNNAMSVR)

Specifies the name or the IP address of the DNS server that HOST will use as its current server for the query session. You can specify any DNS server to which your TCP/IP network has access.

HOST retrieves information from DNS servers. It needs an active DNS server to send its queries to. If you do not specify a DNS server with DMNNAMSVR when you start the tool, it will attempt to set one of the following as its default DNS server for the session:

  1. DNS server your system is configured to use (*CFG), or
  2. The DNS server that is running on your local system.
*CFG
Use the DNS server that is currently designated for use by this system. These server internet addresses can be seen by prompting the Change TCP/IP Domain (CHGTCPDMN) command and looking at the values shown for the INTNETADR parameter.
server-domain-name
Specify the name of a DNS server.
server-internet-address
Specify the IP address of a DNS server.

Display SOA records (SOA)

Specifies whether or not to print the SOA records for zone name from all the listed authoritative name servers for that zone. The list of name servers is defined by the NS records that are found for the zone.

*NO
Do not print SOA records.
*YES
Attempt to print SOA records.

List all hosts (AXFR)

Specifies whether or not to make HOST perform a zone transfer for zone specified in the HOSTNAME parameter. A zone transfer is when all domain information in the zone is returned. HOST will display the NS, PTR and address records (A/AAAA).

*NO
Do not perform a zone tranfer.
*YES
Perform a zone transfer.

Use IP6.INT domain (IP6INT)

Specifies whether or not to qualify the reverse lookup to be in the ip6.int zone and not the ip6.arpa zone.

*NO
The normal ip6.arpa zone reverse lookup will be performed.
*YES
An IPv6 address reverse lookup in the ip6.int zone will be performed. This zone is deprecated, but may still be required to query IPv6 backbone prefixes.

Recursion desired (SETRDFLAG)

Specifies whether or not to set the Recursion Desired (RD) flag in the query. This should mean that the name server receiving the query will not attempt to resolve name. This enables HOST to mimic the behaviour of a name server by making non-recursive queries and expecting to receive answers to those queries that are usually referrals to other name servers.

*YES
Set the RD flag.
*NO
Do not set the RD flag.

Network protocol (PROTOCOL)

Specified whether to use TCP or UDP when sending requests to the server.

*UDP
Use UDP to send the query. However, TCP will be automatically selected for queries that require it, such as zone transfer (AXFR) requests.
*TCP
Use TCP to send the query.

Show debug information (DEBUG)

Specifies whether or not to turn debugging mode on. More information is displayed about the packet sent to the server and the resulting answer when debugging mode is on.

*NO
Turn off debugging messages.
*YES
Turn on debugging messages.

IP Version (IPVSN)

Specifies whether to limit the query to IPv4 or IPv6 networks.

*ALL
Do not limit queries to IPv4 or IPv6.
*IPV4ONLY
Only send queries out IPv4 network interfaces.
*IPV6ONLY
Only send queries out IPv6 network interfaces.

Number of dots (NBRDOTS)

Specifies the number of dots (period characters) that have to appear in a domain name for it to be considered absolute. Names with fewer dots are interpreted as relative names and will be searched for in the domains listed in the DMNSCHLIST parameter.

1
If the domain name contains one dot it is considered an absolute name.
0-10
Specify the number of dots that must be in a domain name for the domain name to be considered to be an absolute name.

Query timeout (TIMEOUT)

Specifies the timeout interval, in seconds, to wait for a response.

5
A timeout value of 5 seconds is used.
1-100
Specify a valid timeout value in seconds.

UDP retry (UDPNBRRTY)

Specifies the number of times to retry UDP queries to the current DNS server before attempting TCP queries.

2
Two UDP retries will be used. This is in addition to the initial query.
0-100
Specify the number of UDP retries. You normally only need to retry a query 3 to 5 times.

Output file (TOSTMF)

Specifies the name of a stream file where all command output is written.

*STDOUT
All command output goes to the standard output device (normally the display).
path-name
Specify the path name for a stream file where output should be written.

Examples

Example 1: Looking Up Internet Address for Domain Name

STRHOSTQRY  HOSTNAME(ibm.com)

This command attempts to find information about the domain 'aol.com'. This includes A and MX records, althought the output is formatted in a different style than other query tools (e.g. DIG). Sample output from this query might look like this:

Using domain server:
Name: 9.5.176.200
Address: 9.5.176.200#53
Aliases:
aol.com has address 64.12.50.151
aol.com has address 205.188.142.182
aol.com mail is handled by 15 mailin-01.mx.aol.com.
aol.com mail is handled by 15 mailin-02.mx.aol.com.
aol.com mail is handled by 15 mailin-03.mx.aol.com.
aol.com mail is handled by 15 mailin-04.mx.aol.com.

Example 2: Lookup with a Zone Transfer

HOST   HOSTNAME(i5os.ibm.com)  AXFR(*YES)

This command attempts to do a zone transfer. Sample output from this query might look like this:

Using domain server:
Name: 10.0.1.100
Address: 10.0.1.100#53
Aliases:
i5os.ibm.com name server MYDNS1.IBM.COM.
i5os.ibm.com name server MYDNS2.IBM.COM.
i5os.ibm.com has address 10.0.1.100
i5os.ibm.com has address 10.0.2.200
box1.i5os.ibm.com has address 10.0.2.201
box2.i5os.ibm.com has address 10.0.2.202

This command attempts to do the same zone transfer, but fails because the user is not authorized to do transfers. Sample output from this query might look like this:

Using domain server:
Name: 10.0.1.100
Address: 10.0.1.100#53
Aliases:
Host i5os.ibm.com not found: 9(NOTAUTH)
; Transfer failed.

Error messages

*ESCAPE Messages

DNS0013
Error processing command parameters.
DNS0065
Option 33 of i5/OS is required, but is not installed.
TCP7124
Program &1 in library &2 type *PGM ended abnormally.