Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

get-host() Function (SLAX)

Namespaces

SLAX Syntax

Description

Return information about the given DNS hostname, IPv4 address, or IPv6 address.

When you execute the get-host() function, the system queries the DNS server, unless the result is cached locally in /etc/host.

Parameters

address

Hostname, IPv4 address, or IPv6 address for which to return information.

Return Value

result

Node set containing a <host> element that encloses the following child elements with information about the specified host:

  • <hostname>—Fully qualified domain name of the host

  • <address-family>—Address family, which returns inet for IPv4 addresses or inet6 for IPv6 addresses

  • <address>—IPv4 address or IPv6 address of the host

  • <alias>—Alternate hostname that is emitted if it is defined

Usage Examples

The following script retrieves the host information for localhost and for the host at the given IP address.

The returned host information is:

Release Information

Function introduced in SLAX version 1.3.