Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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 github.com [192.30.252.129] port 22. debug1: connect to address 192.30.252.129 port 22: Connection refused ssh: connect to host github.com 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.

R

share|improve this question
add comment

1 Answer

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

dig github.com 

;; ANSWER SECTION:
github.com.     30  IN  A   192.30.252.131

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. linux.die.net/man/8/nscd 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
add comment

Your Answer

 
discard

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.