-1

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

RDRAO
  • 1
  • 1
  • 2

1 Answers1

0

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.

  • /etc/nscd.conf in DNS server or Dev server....cos in Dev server there is no nscd.conf – RDRAO Nov 01 '13 at 00:25
  • nscd is caching server for network service lookups. It would be on the dev server. http://linux.die.net/man/8/nscd Another place to look is /etc/nsswitch.conf – Fred the Magic Wonder Dog Nov 01 '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 03 '13 at 21:04
  • Try switching the order of the hosts line `hosts: dns files` – Fred the Magic Wonder Dog Nov 04 '13 at 14:30