nsquery (used in some HP-UX/Unix name-service diagnostic toolsets) directly queries the configured name-service resolution order (as set in the name service switch configuration) to confirm that hostname lookups are actually resolving via DNS/BIND the way they're supposed to. Plain hostname just reports the local machine's own name, gethostbyname is a C library call rather than an interactive diagnostic command, and whois queries domain registration data, not DNS/BIND resolution itself.