Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 strange problem. On one of my dev server i use git clone command to connect to github. I have set up my keys already. The connection between the dev server and github is intermittent.

When it works it works like a charm. The next minute with me doing no changes to any of the server configfurations, the connection does not work . It throws up the following error

`Initialized empty Git repository in /home/donrag/todelete/test/.git/

debug1: Connecting to [] port 22. debug1: connect to address port 22: Connection refused ssh: connect to host port 22: Connection refused fatal: The remote end hung up unexpectedly`

I am not sure how to fix this or even where to look into. Can someone please help.


share|improve this question

Github is behind some kind of web load balancer. When you do the DNS lookup of


;; ANSWER SECTION:     30  IN  A

you get a record with at most a 30 sec ttl. It's more than likely that something in your environment is holding on to the DNS record much longer than it should. The first place I would look is nscd, it's notorious for causing these kinds of problems. Look in /etc/nscd.conf and see if you are caching the hosts records.

share|improve this answer
/etc/nscd.conf in DNS server or Dev server....cos in Dev server there is no nscd.conf – RDRAO Nov 1 '13 at 0:25
nscd is caching server for network service lookups. It would be on the dev server. Another place to look is /etc/nsswitch.conf – Fred the Magic Wonder Dog Nov 1 '13 at 14:45
this is what my nsswithch looks like passwd: files shadow: files group: files #hosts: db files nisplus nis dns hosts: files dns bootparams: nisplus [NOTFOUND=return] files ethers: files netmasks: files networks: files protocols: files rpc: files services: files netgroup: nisplus publickey: nisplus automount: files nisplus aliases: files nisplus – RDRAO Nov 3 '13 at 21:04
Try switching the order of the hosts line hosts: dns files – Fred the Magic Wonder Dog Nov 4 '13 at 14:30

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.