Solved

DNS host-name resolution

Posted on 2001-07-25
6
222 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
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
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

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!

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…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

772 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