NaviServer - programmable web server

[ Main Table Of Contents | Table Of Contents | Keyword Index ]

# ns_addrbyhost(n) 4.99.8 naviserver "NaviServer Built-in Commands"

## Name

ns_addrbyhost - Forward lookup a hostname to its IP address

## Table Of Contents

## Synopsis

- ns_addrbyhost ?-all? hostname

## Description

This command resolves a hostname to its IP address. If the hostname cannot be resolved, it throws an error.

## COMMANDS

ns_addrbyhost ?-all? hostname

  hostname Name of the hostname to be resolved into IP address. When the option -all is used, the function returns all resolved IP addresses for this host.

## EXAMPLES

     % ns_addrbyhost -all www.aol.com
     205.188.18.208 205.188.19.16 64.12.107.131 64.12.21.3

     % ns_addrbyhost bogus.domain
     could not lookup bogus.domain

## See Also

nsd

## Keywords

ns_hostbyaddr