Solved

DNS host-name resolution

Posted on 2001-07-25
6
223 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
ID: 6317552
0
 
LVL 4

Expert Comment

by:garisoain
ID: 6317607
0
 
LVL 5

Expert Comment

by:vsamtani
ID: 6318001
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
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
LVL 5

Accepted Solution

by:
vsamtani earned 200 total points
ID: 6318015
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
ID: 6318086
=( 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
ID: 6321970
Your help is very much appreciated !!!
0

Featured Post

Connect further...control easier

With the ATEN CE624, you can now enjoy a high-quality visual experience powered by HDBaseT technology and the convenience of a single Cat6 cable to transmit uncompressed video with zero latency and multi-streaming for dual-view applications where remote access is required.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

860 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