| Where allowed to run: All environments (*ALL) Threadsafe: No |
Parameters Examples Error messages |
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:
| Top |
| 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 |
| Top |
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.
| Top |
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.
| Top |
Specifies the protocol group of the information.
HOST HOSTNAME('version.bind') TYPE(*TXT) CLASS(*CH)
STRHOSTQRY NAME('hostname.bind') TYPE(*TXT) CLASS(*CH)
HOST HOSTNAME('ID.SERVER') TYPE(*TXT) CLASS(*CH)
| Top |
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:
| Top |
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.
| Top |
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).
| Top |
Specifies whether or not to qualify the reverse lookup to be in the ip6.int zone and not the ip6.arpa zone.
| Top |
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.
| Top |
Specified whether to use TCP or UDP when sending requests to the server.
| Top |
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.
| Top |
Specifies whether to limit the query to IPv4 or IPv6 networks.
| Top |
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.
| Top |
Specifies the timeout interval, in seconds, to wait for a response.
| Top |
Specifies the number of times to retry UDP queries to the current DNS server before attempting TCP queries.
| Top |
Specifies the name of a stream file where all command output is written.
| Top |
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.
| Top |
*ESCAPE Messages
| Top |