Solved

DNS host-name resolution

Posted on 2001-07-25
6
218 Views
Last Modified: 2010-03-18
Slightly odd one this ......

iIs it possible to configure DNS resolution to return a non-fully qualified host-name????

For example if I enter the following ....

         host <name>

on a unix box, I currently get ...

         <name>.<domain> a.b.c.d

This is fine but I need to just get .....

         <name>  a.b.c.d   (no domain)

Is it possible to achieve this by DNS configuration or do I need to setup some script filtering etc ?????

Many thanks for any help !!!
0
Comment
Question by:rigsby
  • 3
  • 2
6 Comments
 
LVL 4

Expert Comment

by:garisoain
Comment Utility
0
 
LVL 4

Expert Comment

by:garisoain
Comment Utility
0
 
LVL 5

Expert Comment

by:vsamtani
Comment Utility
No, you need a little script filtering. It's not hard though. My version of host requires the following:

#!/bin/bash

echo -n $1
echo -n " "
host $1 | awk 'END {print $4}'


Save the above in your path somewhere, chmod to make it executable, and then

<name of script> <hostname>

If it doesn't work, post the output of your host command here so I can modify the script.

Vijay
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 5

Accepted Solution

by:
vsamtani earned 200 total points
Comment Utility
In fact, the script can be made into a one-liner:

#!/bin/bash
echo $1 `host $1 | awk 'END {print $4}'`

0
 
LVL 4

Expert Comment

by:garisoain
Comment Utility
=( that's what I was trying to post... =/ ... bad look today.

I use:
#!/bin/sh
# script.sh - usage: "script.sh <name>"
IPADDR = `host $1 | awk ' {print $2}'`
echo $1 $IPADDR

gets the same result.

=)
-garisoain
0
 

Author Comment

by:rigsby
Comment Utility
Your help is very much appreciated !!!
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now