05-11-2010 04:36 AM
there are serveral servers in the LAN enviroment,and one server is configured as dns server at /etc/resolv.conf, and there was no /etc/nsswitch.conf at each server. today, the dns server failed, and I could ping all other servers in the LAN, but I could not telnet to them, I could not even telnet itself from every server(telnet hung, like waiting for reply). Was it a usual circumstance? without nsswitch.conf, TCP/IP request would always query dns and would not bypass dns? It confused me, would I "lost" all the servers if the dns server failes?!
Could any one please expain this to me, and thanks a lot!
Solved! Go to Solution.
05-11-2010 04:40 AM
thanks a lot!
05-11-2010 04:59 AM
With DNS server down, you should enter each server into /etc/hosts to provide smooth coomunication between all the servers.
05-11-2010 05:00 AM
By name, or by IP address? As usual, showing
actual commands with their actual output can
be more helpful than vague descriptions and
> [...] I could not telnet to them [...]
"I could not" is not a useful problem
description. It does not say what you did.
It does not say what happened when you did
> [...] telnet hung [...]
Better, but not complete. Where, exactly,
did it hang? (Before the "login" prompt?
After the password response? ...) How long
did you wait for it to unhang?
> [...] would I "lost" all the servers [...]
I don't yet know how "lost" they are?
Are these local servers all specified in each
other's /etc/hosts files?
05-11-2010 05:02 AM
Try to configure a "nsswitch.conf" in one server with something like:
hosts: files [NOTFOUND=continue] dns [UNAVAIL=return]
With this, "telnet hostname" will return you to prompt if DNS server is not responding (and the hostname you want is not in "/etc/hosts" file)
05-11-2010 06:20 AM
1,I tried to ping and telnet all using IPs but not hostname,
2, There was no /etc/nsswitch.conf on each server
3, telnet hung after following output:
Connected to 0.
Escape character is '^]'.
(0 was just one case)
and I could not wait to estimate how long it would hang
4,All servers were at each's /etc/hosts
5,All the time ping was good for every server
6,why it could not telnet itself when there was a default gateway? and could telnet itself when I delete the default gateway?
7,when the dns server fails, there was no way to telnet to or from all the servers?that was really unacceptable!why would this happenï¼
05-11-2010 07:05 AM
"telnet localhost" assumming locahost is in the /etc/hosts file like
"127.0.0.1 localhost loopback"
telnet 0 is not the way to telnet itself.
05-11-2010 08:18 AM
1. cat /etc/hosts
2. netstat -in
3. netstat -nr
4. cat /etc/services|grep telnet
5. cat /etc/inetd.conf|grep telnet
6. arp -a
7. make sure you have entry in /etc/nsswitch.conf: hosts: files [NOTFOUND=continue TRYAGAIN=continue] dns
8. can you do telnet localhost?
05-11-2010 08:48 AM
I have commented the only line of /etc/resolv.conf and restart inetd, and it was ok for telnet. I just want to figure out for what reason could this happen. there was NO /etc/nsswitch.conf at each node(would this force telnet to query dns server without plan b even I did not use hostname?). I am pretty sure that the problem was caused by the failure of dns server, why it queried dns server when I telnet using IPs and what role the default gateway played(without default gateway, host could be telnet from switch) in such LAN enviroment? I consider that it should not query dns server when telnet using IPs, but I now doubt about it. what happened was far beyond my knowledge.
thank you for your reply
05-11-2010 12:30 PM
> it would hang
How long did you wait before you decided not
to wait? Milliseconds? Minutes? Hours?
Days? Any useful info at all?
> [...] (would this force telnet to query dns
> server without plan b even I did not use
> hostname?) [...]
The Telnet server normally tries to get the
name of the client by looking up its IP
address. It doesn't care how the client
found the server. If this (reverse) look-up
is slow (or hangs), then the Telnet
connection may be slow (or hang).
> furthermore, I could not [...]
"I could not" remains useless as a problem
> you got post info to us:
It would probably help if we had some idea of
the IP addresses, netmasks, routes, and so
on. Your opinion of the configuration is
interesting, but may be less valuable than
05-14-2010 04:31 PM
If there is no nsswitch.conf file, the name resolution code assumes a particular set of defaults, which includes using DNS (IIRC).