NETNAME(1)              NetBSD General Commands Manual              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 stan-
     dard 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
     The netname utility exits 0 on success, and >0 if an error occurs.

     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.

NetBSD 8.1                     December 7, 2011                     NetBSD 8.1

You can also request any man page by name and (optionally) by section:

Command: 
Section: 
Architecture: 
Collection: 
 

Use the DEFAULT collection to view manual pages for third-party software.


©1994 Man-cgi 1.15, Panagiotis Christias
©1996-2019 Modified for NetBSD by Kimmo Suominen