- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- nsquery fails to return IP address in a pipe
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2015 05:57 AM - edited 12-10-2015 05:59 AM
12-10-2015 05:57 AM - edited 12-10-2015 05:59 AM
nsquery fails to return IP address in a pipe
nsquery returns a null value for Address: when used in a pipe, redirected or assigned to a variable.
Environment: PARISC running HP-UX 11.31
Examples:
(no pipe = normal behavior)
# nsquery hosts atl1 Using "files [NOTFOUND=continue UNAVAIL=continue] dns" for the hosts policy. Searching /etc/hosts for atl1 Hostname: atl1 Aliases: atl1.corp.ad Address: 10.11.10.200 Switch configuration: Terminates Search
But if the stdout from nsquery is connected using a pipe, redirected to a file or assigned to a variable:
# nsquery hosts atl1 | cat Using "files [NOTFOUND=continue UNAVAIL=continue] dns" for the hosts policy. Searching /etc/hosts for atl1 Hostname: atl1 Aliases: atl1.corp.ad Address: Switch configuration: Terminates Search
# nsquery hosts atl1 | grep Address:
Address:
# nsquery hosts atl1 > nsquery.txt
# cat nsquery.txt
Using "files [NOTFOUND=continue UNAVAIL=continue] dns" for the hosts policy. Searching /etc/hosts for atl1 Hostname: atl1 Aliases: atl1.corp.ad Address: Switch configuration: Terminates Search
If a specified resolver method is used (dns in this case), random text may appear in the pipe:
# nsquery hosts atl1 dns | cat Using "dns" for the hosts policy. Searching dns for atl1 Hostname: atl1.corp.ad Aliases: Address ã Switch configuration: Terminates Search
This has been tested on HP-UX 11.00, 11.11, 11.23 and 11.31, PARISC and IA64.
Only PARISC at 11.31 exhibits this behavior consistently.
A tusc trace shows that a write to stdout is correct using a pipe but the IP address is missing after the pipe.
This has been reported to HP and will be addressed in a future patch.
The lab said that it might occur on other versions of HP-UX.
nsquery is much faster than nslookup in that it does not check DNS server IP and is simpler to try different name resolution methods. However, this error makes it undependable for resolving addresses in scripts.
Bill Hassell, sysadmin
- Tags:
- nsquery