9

I am behind a corporate network. I am unable to use git, since it can't resolve server names

fatal: Unable to look up someserver.org (port 9418) (No such host is known. )

I can't ping that server (name nor ip) either, but my browser is resolving it just fine.

Is there a way to figure out a workaround for this?

1
  • 1
    Put the IP address resolved by the browser in your local hosts file. – jlehtinen Jan 29 '15 at 19:14
2

YES,

Usually corporate networks are behind proxy. Try to find your git repo server public IP (google it), ping it. If it isn't working you are probably behind a proxy server. If you are behind proxy use:

git config --global http.proxy http://proxy_address:proxy_port

git clone http://.../..

You can find proxy address in internet explorer properties\Connections\LAN Settings

enter image description here

If git has still problem resolving address you could try putting git repo public IP DNS to C:\Windows\System32\drivers\etc\hosts file. Git will resolve DNS locally and use proxy for connection.

Here are some additional methods how you can discover proxy:

  1. Open IE, browse to some page next run from cmd:

netstat -ban

(it requires elevated command prompt - probably you can't do it on the corporate computer)

on the left sight under [IEXPLORER.EXE] is your IP on the right sight should be proxy IP and port.

enter image description here

  1. run:

ipconfig /all - find your DNS suffix

ping wpad.suffix or ping wpad

Now use the IP address returned by the ping command and us it in your browser:

http://ipaddress/wpad.dat

It will download wpad.dat file in which you can find line "PROXY ..." containing IP and port of your proxy.

5
  • Only general tab is visible in my case, cannot figure out if proxy is in use. I can't ping ip addresses either. – Kimi Jan 30 '15 at 14:32
  • Company policy to hide settings using GPO on windows probably. I will look in it. Are you able to install software on your corporate computer ? – filvarga Jan 30 '15 at 20:25
  • OK so you have some options to investigate proxy setup: – filvarga Jan 30 '15 at 21:42
  • I think I've managed to get a proxy server address via netstat. I can access webpages via a command line with curl --proxy. But git still fails with "Received HTTP code 407 from proxy after CONNECT". I guess it is another question now, was unable to find a working solution online. – Kimi Feb 2 '15 at 15:40
  • This answer helped me stackoverflow.com/a/25993353/187752. I had to unset the http.proxy and https.proxy variables in global config. – Kimi Feb 2 '15 at 15:53
1

I often use an external, browser based, dns/ip lookup tool, like GetIP, to get the ip address of a server I'm trying to connect to. Then you can use the address for git, svn, etc as long as it's not explicitly blocked by your corporate firewall or proxy.

1
  • I can reach the address via browser, but can't ping neither name nor ip. – Kimi Jan 30 '15 at 14:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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