man1/hostname_lookup

Table of Contents

Name

hostname_lookup - resolve hostnames to IP addresses

Synopsis

hostname_lookup <arg1> <arg2>

Description

hostname_lookup is a helper application used by AccelNET programs to perform forward and reverse DNS lookup.

hostname_lookup accepts a maximum of two arguments.

If only one argument is supplied and it is not "loop" then the program expects that it is performing a DNS forward lookup. The argument is expected to be a DNS name. The program runs a forward lookup query and returns the IP address to stdout. If an IP address is supplied instead the supplied value is printed to stdout.

If two arguments are supplied then the first argument tells the program whether to perform a forward or a reverse lookup. There are several possible values for the argument, fwd, rev, fwd_wait, rev_wait, or loop.

The second argument is the hostname or the IP address as appropriate.

Arguments

fwd <hostname>


This causes the program to perform a forward DNS lookup, i.e. the provided hostname is looked up and an IP address is returned.

If an IP address is supplied for the <hostname> argument the value is simply returned without any lookup being performed.

This command may be issued as <arg1> of the command line arguments or may be used in loop mode.

rev <ip address>


This causes the program to perform a reverse DNS lookup, i.e. the provided IP address is looked up and a hostname is returned.

This command may be issued as <arg1> of the command line arguments or may be used in loop mode.

fwd_wait <hostname>


This causes the program to perform a forward DNS lookup just like the "fwd" command.

This command may only be issued as <arg1> of the command line arguments. It may not be used in loop mode.

The program exits after issuing the response.

rev_wait <hostname>


This causes the program to perform a reverse DNS lookup just like the "rev" command.

This command may only be issued as <arg1> of the command line arguments. It may not be used in loop mode.

The program exits after issuing the response.

loop


This command causes the program to enter loop mode.

exit


This command may only be issued in loop mode and causes the program to exit.

Examples

#
# this example looks up the IP address of "localhost"
#
hostname_lookup localhost
#
# the same thing except two args are supplied
#
hostname_lookup fwd localhost
#
# a reverse lookup
#

hostname_lookup rev 127.0.0.1

Notes


Loop mode was invented to serve the needs of the CONN_CTL package.

Manual page revision

$Id: hostname_lookup.1,v 1.1 2008/11/18 18:27:19 kitchen Exp $


Table of Contents