Unix administration - unable to resolve IP address from hosts file

This is Interesting: Free IT Magazines  
Home > Archive > Unix administration > August 2006 > unable to resolve IP address from hosts file





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author unable to resolve IP address from hosts file
mehaboob@gmail.com

2006-08-23, 1:27 pm

Hi,

I have HP UX box :HP-UX B.11.23 U ia64 0468963392

The /etc/hosts file has entry as below
16.81.21.52 box1.gb.tel.com box1

When I use the command below,
$ping box1.gb.tel.com,the response is fine
PING box1.gb.tel.com: 64 byte packets
64 bytes from 16.81.21.52: icmp_seq=0. time=0. ms
64 bytes from 16.81.21.52: icmp_seq=1. time=0. ms
64 bytes from 16.81.21.52: icmp_seq=2. time=0. ms


But when I tried using the command below,there is no respone
$ping box1

1)Seems like ping command is not looking into /etc/hosts file to get
the ip address
2)Also tried telnet command...similar behaviour is seen.

Tried googling but not of much use.Any idea what could be the reason.

Regards,
Mehaboob

Barry Margolin

2006-08-23, 7:27 pm

In article <1156347500.139559.217550@74g2000cwt.googlegroups.com>,
mehaboob@gmail.com wrote:

> Hi,
>
> I have HP UX box :HP-UX B.11.23 U ia64 0468963392
>
> The /etc/hosts file has entry as below
> 16.81.21.52 box1.gb.tel.com box1
>
> When I use the command below,
> $ping box1.gb.tel.com,the response is fine
> PING box1.gb.tel.com: 64 byte packets
> 64 bytes from 16.81.21.52: icmp_seq=0. time=0. ms
> 64 bytes from 16.81.21.52: icmp_seq=1. time=0. ms
> 64 bytes from 16.81.21.52: icmp_seq=2. time=0. ms
>
>
> But when I tried using the command below,there is no respone
> $ping box1
>
> 1)Seems like ping command is not looking into /etc/hosts file to get
> the ip address
> 2)Also tried telnet command...similar behaviour is seen.
>
> Tried googling but not of much use.Any idea what could be the reason.


Does /etc/nsswitch.conf say to use the hosts file for hostname lookups?

--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
Kevin

2006-08-24, 1:27 am

I encountered the same issue a few years ago. After experimenting with
ideas, I added two seperate entries in /etc/hosts such as follows:

16.81.21.52 box1.gb.tel.com box1
16.81.21.52 box1 box1

You could add multiple instances of hostnames in /etc/hosts so they
point to a specific IP address. It's obvious that this wouldn't be
the proper way of addressing the problem, however, it worked for me.

Kevin Curtis, Jr.
kevin@unixsite.net

Renato

2006-08-24, 7:26 am

mehaboob@gmail.com wrote:
> But when I tried using the command below,there is no respone
> $ping box1


Does HP UX have /etc/resolv.conf ? If so, put the line below on it:
domain gb.tel.com

or, if your domain is other, you can include it on the search:
search yourdomain.com gb.tel.com

Remember that the order is important on search, so if there's a
box1.yourdomain.com it'll be ping'd instead of box1.gb.tel.com.

cheers,
--renato
mehaboob@gmail.com

2006-08-24, 1:38 pm


Renato wrote:

> mehaboob@gmail.com wrote:
>
> Does HP UX have /etc/resolv.conf ? If so, put the line below on it:
> domain gb.tel.com
>
> or, if your domain is other, you can include it on the search:
> search yourdomain.com gb.tel.com
>
> Remember that the order is important on search, so if there's a
> box1.yourdomain.com it'll be ping'd instead of box1.gb.tel.com.
>
> cheers,
> --renato


Hi,

Thanks a lot for the reply.
Updated the /etc/nsswitch.conf to look into the hosts files and DNS.

Thanks,
Mehaboob

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com