[TriLUG] Reverse Lookup Using /etc/hosts
Alexei Znamensky
russoz at gmail.com
Wed Apr 25 16:46:42 EDT 2007
Tarus,
nslookup/host works exclusively with DNS, it doesn't follow the system's
resolver order (read /etc/nsswitch.conf or host.conf).
I could swear that ping would do the trick, but it doesn't. You can always
do it the dirty way:
grep "^${IP_NUMBER}" /etc/hosts | awk '{ print $2 }'
Sorry I dont have anything better right now.
Cheers,
Alexei
On 4/25/07, Tarus Balog <tarus at opennms.org> wrote:
>
> Gang:
>
> I am at a site where a bunch of devices don't reverse resolve via
> DNS. I have a spreadsheet with the IPs and the hostnames so I've
> created an /etc/hosts file in the proper format with that
> information, and in nsswitch.conf I've set hosts to files then dns.
>
> However, host/nslookup will not resolve the IP to a name.
>
> Am I missing something here? I swear I've had this work before.
>
> -T
>
> P.S. CentOS4 if it matters.
> _______________________________________________________________________
> Tarus Balog, OpenNMS Maintainer Main: +1 919 533 0160
> The OpenNMS Group, Inc. Fax: +1 503 961 7746
> Skype: tarusb Direct: +1 919 647 4749
> Email: tarus at opennms.org URL: http://www.opennms.org
> PGP Key Fingerprint: 8945 8521 9771 FEC9 5481 512B FECA 11D2 FD82 B45C
>
>
> --
> TriLUG mailing list : http://www.trilug.org/mailman/listinfo/trilug
> TriLUG Organizational FAQ : http://trilug.org/faq/
> TriLUG Member Services FAQ : http://members.trilug.org/services_faq/
>
--
Alexei Znamensky - russoz_gmail_com
Notícias do Front: http://russoz.wordpress.com/
::: Enquanto Freud explica as coisas, o diabo fica dando os toque...
More information about the TriLUG
mailing list