ping works for IP Addresses but fails for hostname

ping works for IP Addresses but fails for hostname

Post by Intelligent G » Fri, 13 Sep 2002 00:47:54



Hello.

  I have a cable modem connected to my PC through USB and I have
broadband internet by at&t). My PC has both linux and windows ME
installed. I can access internet perfectly when I am using windows ME,
but I cannot do that using Redhat Linux (Ver 7.3).

I checked and found that following files are correct:
/etc/hosts
/etc/hostname
/etc/resolv.conf

Also ifconfig eth0 returns correct values.
I noticed that if i can ping gateways, dns servers, when I use IP
Addresses. When I try to use names, ping responses with error: Unknown
host !!
P.s> I can ping localhost using both name, ipaddress. In other words
linux fails to resolve the name specified in ping command, though DNS
servers are listed correctly in /etc/resolv.conf.

Am I missing something here ?
Any help is appreciated.

 
 
 

ping works for IP Addresses but fails for hostname

Post by John Smit » Fri, 13 Sep 2002 07:30:39


Hello,


Quote:>   I have a cable modem connected to my PC through USB and I have
> broadband internet by at&t). My PC has both linux and windows ME
> installed. I can access internet perfectly when I am using windows ME,
> but I cannot do that using Redhat Linux (Ver 7.3).

> I checked and found that following files are correct:
> /etc/hosts
> /etc/hostname
> /etc/resolv.conf

Are you sure they are correct? Please post their contents.

Quote:> Also ifconfig eth0 returns correct values.
> I noticed that if i can ping gateways, dns servers, when I use IP
> Addresses. When I try to use names, ping responses with error: Unknown
> host !!
> P.s> I can ping localhost using both name, ipaddress. In other words
> linux fails to resolve the name specified in ping command, though DNS
> servers are listed correctly in /etc/resolv.conf.

By correct do you mean that /etc/resolv.conf contains lines such as:

nameserver aaa.bbb.ccc.ddd

Are you sure the IP addresses for the nameservers are correct?

 
 
 

ping works for IP Addresses but fails for hostname

Post by David Efflan » Fri, 13 Sep 2002 10:51:36



Quote:> Hello.

>   I have a cable modem connected to my PC through USB and I have
> broadband internet by at&t). My PC has both linux and windows ME
> installed. I can access internet perfectly when I am using windows ME,
> but I cannot do that using Redhat Linux (Ver 7.3).

> I checked and found that following files are correct:
> /etc/hosts
> /etc/hostname
> /etc/resolv.conf

> Also ifconfig eth0 returns correct values.
> I noticed that if i can ping gateways, dns servers, when I use IP
> Addresses. When I try to use names, ping responses with error: Unknown
> host !!
> P.s> I can ping localhost using both name, ipaddress. In other words
> linux fails to resolve the name specified in ping command, though DNS
> servers are listed correctly in /etc/resolv.conf.

Check to make sure you do not have a comma where a dot belongs in
resolv.conf (typos can though you).  Also check firewall logs.  I have not
run RH 7.x versions, but I hear the default firewall is strict.

--
David Efflandt - All spam ignored  http://www.de-srv.com/
http://www.autox.chicago.il.us/  http://www.berniesfloral.net/
http://cgi-help.virtualave.net/  http://hammer.prohosting.com/~cgi-wiz/

 
 
 

ping works for IP Addresses but fails for hostname

Post by Intelligent G » Fri, 13 Sep 2002 13:10:31


Hi John,
   Yes I am sure they are correct. Actually during Linux startup, the
values are automatically updated, and I can ping nameservers

Contents of /etc/resolv.conf

nameserver 63.240.76.4
nameserver 204.127.198.4
search     attbi.com

I cant think, why it wont work, coz I can ping anything with Ip
address. For example ping 64.58.76.233 works, but ping www.yahoo.com
fails.

www.yahoo.com = 64.58.76.233.

Thanks in advance for help.


> Hello,



> >   I have a cable modem connected to my PC through USB and I have
> > broadband internet by at&t). My PC has both linux and windows ME
> > installed. I can access internet perfectly when I am using windows ME,
> > but I cannot do that using Redhat Linux (Ver 7.3).

> > I checked and found that following files are correct:
> > /etc/hosts
> > /etc/hostname
> > /etc/resolv.conf

> Are you sure they are correct? Please post their contents.

> > Also ifconfig eth0 returns correct values.
> > I noticed that if i can ping gateways, dns servers, when I use IP
> > Addresses. When I try to use names, ping responses with error: Unknown
> > host !!
> > P.s> I can ping localhost using both name, ipaddress. In other words
> > linux fails to resolve the name specified in ping command, though DNS
> > servers are listed correctly in /etc/resolv.conf.

> By correct do you mean that /etc/resolv.conf contains lines such as:

> nameserver aaa.bbb.ccc.ddd

> Are you sure the IP addresses for the nameservers are correct?

 
 
 

ping works for IP Addresses but fails for hostname

Post by John Smit » Fri, 13 Sep 2002 13:22:25


Yes i checked for typos, and there are none. I am not sure about firewall
though. Should I stop firewall and then test ?



> > Hello.

> >   I have a cable modem connected to my PC through USB and I have
> > broadband internet by at&t). My PC has both linux and windows ME
> > installed. I can access internet perfectly when I am using windows ME,
> > but I cannot do that using Redhat Linux (Ver 7.3).

> > I checked and found that following files are correct:
> > /etc/hosts
> > /etc/hostname
> > /etc/resolv.conf

> > Also ifconfig eth0 returns correct values.
> > I noticed that if i can ping gateways, dns servers, when I use IP
> > Addresses. When I try to use names, ping responses with error: Unknown
> > host !!
> > P.s> I can ping localhost using both name, ipaddress. In other words
> > linux fails to resolve the name specified in ping command, though DNS
> > servers are listed correctly in /etc/resolv.conf.

> Check to make sure you do not have a comma where a dot belongs in
> resolv.conf (typos can though you).  Also check firewall logs.  I have not
> run RH 7.x versions, but I hear the default firewall is strict.

> --
> David Efflandt - All spam ignored  http://www.de-srv.com/
> http://www.autox.chicago.il.us/  http://www.berniesfloral.net/
> http://cgi-help.virtualave.net/  http://hammer.prohosting.com/~cgi-wiz/

 
 
 

ping works for IP Addresses but fails for hostname

Post by Richar » Fri, 13 Sep 2002 22:37:57



> Hi John,
>    Yes I am sure they are correct. Actually during Linux startup, the
> values are automatically updated, and I can ping nameservers

> Contents of /etc/resolv.conf

> nameserver 63.240.76.4
> nameserver 204.127.198.4
> search     attbi.com

> I cant think, why it wont work, coz I can ping anything with Ip
> address. For example ping 64.58.76.233 works, but ping www.yahoo.com
> fails.

I had the same problem when I first set up my cable modem. On mine it was a
DNS problem.
I run SuSE 8.0 so my setup/configuration is somewhat diferent from yours.  
On my problem I found that I had to set up the DNS for each NIC via YAST2,
the SuSE configurator.  Having the info in resolv.conf wasn't enough. My
resolv.conf is modified by dhcpcd while running so it reflects the DNS set
by YAST2. Maybe one of the RH Gurus could tell you where to set the DNS.  
Also, I had to go to each computer in my subnet and specifically set each
DNS.

Hope this helps some.
Richard  

 
 
 

ping works for IP Addresses but fails for hostname

Post by Dave Carriga » Sat, 14 Sep 2002 00:48:06



>   I have a cable modem connected to my PC through USB and I have
> broadband internet by at&t). My PC has both linux and windows ME
> installed. I can access internet perfectly when I am using windows ME,
> but I cannot do that using Redhat Linux (Ver 7.3).

> I checked and found that following files are correct:
> /etc/hosts
> /etc/hostname
> /etc/resolv.conf

> Also ifconfig eth0 returns correct values.
> I noticed that if i can ping gateways, dns servers, when I use IP
> Addresses. When I try to use names, ping responses with error: Unknown
> host !!
> P.s> I can ping localhost using both name, ipaddress. In other words
> linux fails to resolve the name specified in ping command, though DNS
> servers are listed correctly in /etc/resolv.conf.

This is almost certainly a DNS problem. First, check your
/etc/nsswitch.conf file and make sure you actually have dns enabled for
host lookups. Next, start testing dns with tools like dig or host. i.e.,
`dig a www.yahoo.com', etc. If that fails, try dig again against some
other known nameserver (one that's not in your resolv.conf).

--
Dave Carrigan
Seattle, WA, USA

UNIX-Apache-Perl-Linux-Firewalls-LDAP-C-C++-DNS-PalmOS-PostgreSQL-MySQL

Dave is currently listening to Alarm - Unsafe Building (Standards)