Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX Reference > N

nsquery(1)

HP-UX 11i Version 3: February 2007
» 

Technical documentation

» Feedback
Content starts here

 » Table of Contents

 » Index

NAME

nsquery — query the Name Service Switch backend libraries

SYNOPSIS

nsquery lookup_type lookup_query [lookup_policy]

DESCRIPTION

nsquery is used to find the Name Service that returned the response to a getaddrinfo(), gethostbyname(), gethostbyaddr(), getnameinfo(), getpwnam(), getpwuid(), getgrnam(), or getgrgid() function call. This application is Name Service Switch aware and follows the lookup policies in /etc/nsswitch.conf. The supported lookup_type values are:

hosts

Used to resolve host name or IP Address lookups.

passwd

Used to resolve user name or UID lookups.

group

Used to resolve group name or GID lookups.

ipnodes

Used to resolve host name or IP Address lookups. Only IPv6 and IPv4-mapped IPv6 address will be displayed for host name lookups.

The lookup_query can either be a host name, IP Address (IPv4 only), user name, user ID, group name, or group ID.

The lookup_policy must be a valid lookup policy described in nsswitch.conf(4). If the policy is invalid, the system default policy will be used. The default values for lookup_policy are:

hosts

dns [NOTFOUND=return] nis [NOTFOUND=return] files

passwd

files nis

group

files nis

ipnodes

dns [NOTFOUND=return] files

nsquery will display the lookup policy being used, the name of the service being queried, and the result of the query.

EXAMPLES

Lookup host hondo using the default hosts lookup policy.

nsquery hosts hondo

Lookup host with ip address 15.204.204.204 using "dns files" as the hosts lookup policy.

nsquery hosts 15.204.204.204 "dns files"

Lookup user dog using "ldap" as the passwd lookup policy.

nsquery passwd dog "ldap"

Lookup user ID 105 using the default passwd lookup policy.

nsquery passwd 105

Lookup group wayne using group lookup policy "nis [NOTFOUND=RETURN] files".

nsquery group wayne "nis [NOTFOUND=RETURN] files"

Lookup group 22 using the default group lookup policy.

nsquery group 22

Lookup host rio using "dns" as the ipnodes lookup policy.

nsquery ipnodes rio "dns"

RETURN VALUE

nsquery returns the following values:

0

Success.

1

Invalid Usage.

2

Unknown Action.

3

No match found in any name services queried.

AUTHOR

nsquery was developed by Hewlett-Packard.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1983-2007 Hewlett-Packard Development Company, L.P.