Why would Linux suddenly stop reading /etc/hosts ?
Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Why would Linux suddenly stop reading /etc/hosts ?
The subject about says it all. Ubuntu 9.10 64 bit (probably the answer) on a Dell Studio XPS 8000. I have entries in my /etc/hosts for other machines on my LAN.
All of the sudden I cannot ssh to taylor12wd (wired connection to my netbook) nor taylor13wl (wireless connection to same). Nor can I ping the machine.
Quote:
ken@taylor12:~$ ssh taylor12wl
ssh: connect to host taylor12wl port 22: No route to host
Quote:
PING taylor12wl (208.69.36.132) 56(84) bytes of data.
64 bytes from hit-nxdomain.opendns.com (208.69.36.132): icmp_seq=1 ttl=48 time=77.4 ms
I can connect or ping if I use the IP address and Gnome Commander and Nautilus can connect over ssh! Only the shell does not work.
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,233
Rep:
first of all, post the results of 'ifconfig'
no route to host usually meahs that the machine you are trying to talk to is on a different network/subnet then the one you are using, if it wasnt reading the /etc/hosts the error would be
'unknown host' or something like that
First thing is that taylor12wd is not in your /etc/hosts. A typo on your posting?
Second thing is you are getting address resolution OK, but not connection, according to "No route to host". Maybe it's getting an address, but getting the wrong address.
Please provide a copy of the file "/etc/nsswitch.conf" in your next post. For comparison, mine looks like this:
Code:
# /etc/nsswitch.conf
#
# Example configuration of GNU Name Service Switch functionality.
# If you have the `glibc-doc-reference' and `info' packages installed, try:
# `info libc "Name Service Switch"' for information about this file.
passwd: compat
group: compat
shadow: compat
hosts: files dns
networks: files
protocols: db files
services: db files
ethers: db files
rpc: db files
netgroup: nis
You may want to open a 2nd window at the same time and run the command:
Code:
tcpdump -nnl -i eth0 -s 1536
to watch the traffic and, in particular, see if the packets are going to the intended IP address, or some other. Watch for the DNS queries (".53" will be appended to addresses) to see if the lookups are going that way. Look for any queries with "AAAA?" in them, indicating an IPv6 lookup happening.
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:4 errors:0 dropped:0 overruns:0 frame:0
TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:240 (240.0 B) TX bytes:240 (240.0 B)
Yes Skaperen, a typo. Trying to connect to taylor13wl
As requested
Quote:
ken@taylor12:~$ cat /etc/nsswitch.conf
# /etc/nsswitch.conf
#
# Example configuration of GNU Name Service Switch functionality.
# If you have the `glibc-doc-reference' and `info' packages installed, try:
# `info libc "Name Service Switch"' for information about this file.
passwd: compat
group: compat
shadow: compat
hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4
networks: files
protocols: db files
services: db files
ethers: db files
rpc: db files
netgroup: nis
I will try the tcpdump if/when it happens again. Had to reboot my desktop - was burning a DVD and apparently the media was bad. Causes the 800 horsepower machine to grind to a complete halt. Of course I can now connect to the netbook.
I have to say that Ubuntu 9.10, at least the 64 bit version, is the sorriest release of Ubuntu I have used and I have used it since 6.04. Lucid Lynx seems better, even in the alphas. When the beta comes out in a week I will be installing it on this Studio XPS and see what it can do. Other than networking and some hardware strangeness, most of my issues are, I think, associated with the restricted nVidia driver. Lucid has the 2.6.32 kernel which has the open source nVidia driver built in as I understand. Also does away with HAL Can't be any worse
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.