- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Return Short Names in DNS
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
01-13-2003 02:00 PM
01-13-2003 02:00 PM
Return Short Names in DNS
named so that when a
query is resolved, only the
short name and the IP are
returned?
Example:
nslookup hpserver
Returns:
hpserver.mycompany.com
192.168.1.225
What I would like to see
is it returning:
hpserver
192.168.1.225
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2003 02:25 PM
01-13-2003 02:25 PM
Re: Return Short Names in DNS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-13-2003 02:53 PM
01-13-2003 02:53 PM
Re: Return Short Names in DNS
Only query you can specify with short names by specifying search in /etc/resolv.conf.
But when it returns it returns a full name only.
I see only one possibility to trim this is by using your won c program which uses gethostbyaddr() and gethostbyname() library. Using these you can definately return a short name.
Cheers
Rajeev
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2003 01:16 AM
01-14-2003 01:16 AM
Re: Return Short Names in DNS
$ getip localhost
127.0.0.1
$
Regards,
Steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2003 07:09 AM
01-14-2003 07:09 AM
Re: Return Short Names in DNS
alias nslookup=/usr/local/bin/my-nslookup
Then my-nslookup could be a script that would perform an nslookup, then use sed or awk, etc, to make the output appear as you like.
If you only wanted your own domain to go away but display others, a simple sed could do it:
nslookup $1 | sed 's/\.mycompany\.com//'
That's a crude example but it could be done.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2003 07:15 AM
01-14-2003 07:15 AM
Re: Return Short Names in DNS
It's simple to get just the first word:
nsquery hosts hpserver | grep "^Hostname" | cut -f2 -d" " | cut -f1 -d"."
(Note that the commands above are meant to be a one-liner - your browser may wrap them.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-14-2003 07:20 AM
01-14-2003 07:20 AM
Re: Return Short Names in DNS
nslookup 3.1.3.1 | awk -F. '{print $1}' would omit domain/sub-domain information.
Regards,
Shannon