NETNAME(1)

NAME
netname - Return the canonical network name and/or addresses of a host

SYNOPSIS
netname [-adn46] [host | address]
netname -v

DESCRIPTION
netname returns the canonical name of the given host or address on standard output. If no host is given, the name of the local machine is used.

If the -d option is specified, only the domain part of the canonical name is returned. A top-level name (a name without any dots) is its own domain.

The -n option returns all the addresses found for the host. You can limit addresses to IPv4 addresses using the -4 option, or to IPv6 addresses using the -6 option instead.

The -a option will perform a reverse lookup on each address and print it with its associated name. This is primarily useful for debugging DNS and the resolver functionality of the host.

Use the -v option to check the version of the binary.

EXAMPLES

    HOST=$(netname)
    setenv HOST `netname`

DIAGNOSTICS

0   Successful completion.
1   Incorrect usage.
2   Failed to retrieve information.

SEE ALSO
hostname(1), nodename(1), uname(1), uname(2), getaddrinfo(3), getnameinfo(3)

AUTHORS
Kimmo Suominen <kim@tac.nyc.ny.us>

BUGS
No known bugs.