
DNS_LOOKUP table function
The DNS_LOOKUP table function queries a domain name server for IP address information about a hostname.
Authorization: If the HOSTALIASES environment variable is set, the caller must have:
- Execute (*X) data authority to each directory in the path of the host aliases file specified by the HOSTALIASES environment variable, and
- Read (*R) data authority to the host aliases file.
The schema is QSYS2.
- search-name
- A character string containing the fully qualified domain name of the host to be resolved.
- domain-server
- A character string containing either a host name or an IP address for the domain name server, or an IP address string for it.
The result of the function is a table containing rows with the format shown in the following table. All columns are nullable.
Column Name | Data Type | Description |
---|---|---|
ADDRESS_SPACE_TYPE | CHAR(4) | The IP address space type for IP_ADDRESS
|
IP_ADDRESS | VARCHAR(45) | The IP address. When ADDRESS_SPACE_TYPE is IPV4, the address is in IPv4 format. When ADDRESS_SPACE_TYPE is IPV6, the address is in IPv6 format. |
AUTHORITATIVE | VARCHAR(3) | Indicates whether the DNS response containing the IP
address was an authoritative answer.
|
AUTHENTICATED_DATA | VARCHAR(3) | Whether the data was authenticated.
|
Example
- Determine the IP address for the ibm.com hostname.
SELECT * FROM TABLE(QSYS2.DNS_LOOKUP('ibm.com'));
