- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Command To Return Alias
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
Forums
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
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
10-17-2001 06:10 AM
10-17-2001 06:10 AM
Command To Return Alias
Trying DNS
Name: mike.bla.com
Address: 1.2.3.4
Aliases: dogs.bla.com
In the above example, I would like to return just "dogs".
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2001 06:19 AM
10-17-2001 06:19 AM
Re: Command To Return Alias
I dont think there is an option to nslookup to do what you want.
You'll have to do something more complex;
nslookup
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2001 06:20 AM
10-17-2001 06:20 AM
Re: Command To Return Alias
try the command:
# nslookup mike |
awk '$1 == "Aliases:" { print $2 }'
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2001 06:33 AM
10-17-2001 06:33 AM
Re: Command To Return Alias
gethostent
would be the systemcall of you choice.
Basic problem is, that there might be more than one alias, and which one would you focus on.
man gethostent
shows the datastructures for this. The only thing you need to decide is how to process the char-array of the alias entries -> may be "return all up to the first dot in the first alias" or so.
This should fit onto one screen page.
Hope this helps
Volker
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2001 06:33 AM
10-17-2001 06:33 AM
Re: Command To Return Alias
nslookup
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-17-2001 06:43 AM
10-17-2001 06:43 AM
Re: Command To Return Alias
"dogs" alone may not work (depending on the contents of your "/etc/resolv.conf"), so you will have to show the FQDN, not just the "shortname"...
Have you tried some newer commands instead of "nslookup", like they are used for BIND9?
Have a look at the BIND9 documentation and have a look at the home-page of "Men&Mice", as they do a lot of work (and docu) on and about DNS and see especially Cricket Liu's corner (the one who did the O'Reilly book!):
http://www.menandmice.com/9000/9300_DNS_Corner.html
HTH,
Wodisch