Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a small business network with several servers on it. To simplify things, I added a BIND9 DNS server on one of them, with entries for each of the local machines, i.e.,,, and so on. These entries are only served to the local network. When I do an nslookup on, say,, I always get the expected, valid response. However, more often than not, an attempt to SSH to that server fails, as so:

# nslookup

Non-authoritative answer:

# ssh
(after a ~10 second pause)
ssh: Could not resolve hostname Name or service not known

# ssh user@
[Connects immediately]

Web requests to succeed, as do connections from other applications.

This happens intermittently and seems to be tied to network or server restarts. After everything has been up for a day or two, the problem seems to go away, presumably as the client cache finally figures things out(?). I'm seeing it on my Mac and Windows machines. Any suggestions?

share|improve this question
try running ssh with verbose mode ssh -v and post output. – alexus Aug 28 '14 at 16:28
Wouldn't you know, the whole 'issue disappearing after a few days' thing is kicking in. Let me go poke the servers with a stick and see if I can get em to do it again. God I hate debugging "intermittent" problems :( – Chris Aug 28 '14 at 16:43
look into your DNS, maybe problem is in there.. – alexus Aug 28 '14 at 16:53
up vote 3 down vote accepted

Since you have anonymized the domain name you have hidden important information. Does the domain name of the service you are connected to happen to end in .local?

Nslookup sends lookups directly to the DNS servers. SSH makes a call to the system asking for it to resolve the name, which may use DNS, but may also use a hosts file, multicast-DNS(bonjour), or other name-resolution protocols. So most likely one of your other configured name resolution methods is screwed up.

See the hosts line in your /etc/nsswitch.conf for the configured name resolution services.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.