Guest phil3k Posted May 5, 2005 Report Share Posted May 5, 2005 (edited) hello everybody, i'm using mandrake 10.0 official and i have a weird networking problem: although my /etc/hosts seems to be alright, i can't ping any machines in my network by hostname and, whenever my router is down or the network cable is unplugged, programs take very long to start up. here's my /etc/hosts: 127.0.0.1 localhost 192.168.1.201 hal9000 # my ip-address and my hostname 192.168.1.2 homer #ip-address and hostname of another pc in my LAN strangely, pinging one of the machines in /etc/hosts by hostname gives an 'unknown host'-error, whereas 'ping localhost' and pinging by ip-address work. even more strangely, this problem only occurs when i have specified a nameserver in /etc/resolv.conf - when this file is empty, i _can_ ping myself by hostname (of course, internet doesn't work then *g*). what can i do to fix this? any help apprecciated :-) Edited May 6, 2005 by Qchem Quote Link to comment Share on other sites More sharing options...
ianw1974 Posted May 5, 2005 Report Share Posted May 5, 2005 (edited) Just to clarify, when you ping by IP address, can you ping any other system. Or can you just ping yourself? Do you have any firewall software on the other machines (or even this one) which might be blocking icmp (ping) requests? Also, how do you access the internet? Via a DSL router or some other means? Edited May 5, 2005 by ianw1974 Quote Link to comment Share on other sites More sharing options...
Guest phil3k Posted May 5, 2005 Report Share Posted May 5, 2005 i can ping other systems in my LAN by IP address, but not by their hostname (although it is specified in my /etc/hosts). internet works just fine, via a DSL router. i have no firewall software installed, neither do any other machines in my LAN. Quote Link to comment Share on other sites More sharing options...
ianw1974 Posted May 5, 2005 Report Share Posted May 5, 2005 Do you have all machines using the DSL as the default gateway? I have a similar setup (different IP addresses), but a handful of machines, a DSL router and a hardware firewall in between the internet connection. I had an icmp ping problem earlier because the Windows firewall was on one of the machine I tried to contact. As you don't have the firewalls, this shouldn't be a problem for you. When you configured the network, did you configure the following items: IP Subnet Gateway DNS entries Hostname for your machine I left zeroconf blank as it's not normally needed. I also left the fully qualified domainname blank when I configured the hostname, as it's not really needed anyhow. Quote Link to comment Share on other sites More sharing options...
streeter Posted May 5, 2005 Report Share Posted May 5, 2005 Have a look in /etc/nsswitch.conf - mine has a line hosts: files nisplus nis dns This tells the machine to look at the hosts file first (files) then nis etc. when doing hostname lookups. If yours is different, i.e no files entry, or dns is listed first, this may be the problem. Chris Quote Link to comment Share on other sites More sharing options...
Guest phil3k Posted May 5, 2005 Report Share Posted May 5, 2005 yes, all machines use the DSL router as default gateway. my network configuration seems to be ok - i set my IP address, gateway, DNS, and hostname (no localdomain). to me, the problem seems to be that, when i send a 'ping' command, mandrake looks up the specified hostname at the nameserver set in resolv.conf, instead of searching my /etc/hosts first. thus, when no nameserver is set, pinging by hostname does work. do you have any idea how i can change the order in which mandrake looks up the hostnames? Quote Link to comment Share on other sites More sharing options...
Guest phil3k Posted May 5, 2005 Report Share Posted May 5, 2005 (edited) Have a look in /etc/nsswitch.conf - mine has a line hosts: files nisplus nis dns This tells the machine to look at the hosts file first (files) then nis etc. when doing hostname lookups. If yours is different, i.e no files entry, or dns is listed first, this may be the problem. Chris <{POST_SNAPBACK}> thank you - that solved my problem :-) Edited May 5, 2005 by phil3k Quote Link to comment Share on other sites More sharing options...
ianw1974 Posted May 5, 2005 Report Share Posted May 5, 2005 Glad it's all OK, I was about to say that the only other time I've seen this a problem is when a network card has been forced to a speed/duplex setting and the switch/hub was on auto-negotiate (or vice versa). But as you're OK now, you won't need to worry about this! :P Quote Link to comment Share on other sites More sharing options...
Guest phil3k Posted May 5, 2005 Report Share Posted May 5, 2005 thank you everybody - so my pinging problem is now solved. but i just discovered that another issue still persists: when my network connection is down (e.g. cable unplugged *g*), programs take a lot longer to start up - i also held my hostname problem responsible for that, since this usually seems to be caused by missing entries in /etc/hosts. any ideas? Quote Link to comment Share on other sites More sharing options...
Guest phil3k Posted May 5, 2005 Report Share Posted May 5, 2005 ok, forget about my last post; after rebooting, this seems to be solved, too (although i did "service network restart" before...) - sorry! thanx again for your quick help :-) ! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.