3

I've recently begun to use GIT repositories for Node.js, Socket.io, websockets, etc. The specific project isn't important here, what is is I'm unable to connect anywhere outside of localhost using the command line on my OSX computer. I am using a proxy.

This is a problem because I'm completely unable to clone GIT repositories to my machine, or install certain repositories/programs from the command line as they use the internet and return complicated errors when trying to do so.

The strange thing is I'm able to connect to the internet through my browser just fine--I'm posting from the machine as we speak!

When trying to ping google:

ME$ ping google.com
ping: cannot resolve google.com: Unknown host

When trying to "host" google:

ME$ host google.com
Host google.com not found: 3(NXDOMAIN)

When trying to "whois" google:

ME$ whois google.com
whois: com.whois-servers.net: nodename nor servname provided, or not known

When trying to curl google:

ME$ curl google.com
curl: (6) Couldn't resolve host 'google.com'

Contents of my resolv.conf file:

search d###.t###.u#.t##### i#####.t###.u#.t#####
nameserver 172.##.##.#

When trying to get a GIT repository:

ME$ sudo git clone http://github.com/isaacs/npm.git
Cloning into npm...
error: Couldn't resolve host 'github.com' while accessing 

http://github.com/isaacs/npm.git/info/refs

fatal: HTTP request failed

I also have the list of my resolvers if you'd like them; not sure how secure it would be posting them here. Probably completely fine.

Will update with all information anyone asks me to check for. Thank you! :)

Update: This problem seems to be affecting more than one computer at my office (where I'm posting this from). Either that means it's a problem outside the hands of an individual computer, or each time a computer is installed, it was given this problem inadvertently.

And there is a tech guy, but his know-how stops at Macs :P

Update: Someone asked me to post the results of "netstat -rn":

Routing tables

Internet:
Destination........Gateway............Flags........Refs......Use...Netif.Expire
default............172.16.112.254.....UGSc............3........0.....en0
127................127.0.0.1..........UCS.............0........0.....lo0
127.0.0.1..........127.0.0.1..........UH..............0.....6008.....lo0
169.254............link#4.............UCS.............0........0.....en0
172.16.112/24......link#4.............UCS.............1........0.....en0
172.16.112.247.....127.0.0.1..........UHS.............0........0.....lo0
172.16.112.254.....e0:5f:b9:4f:bf:53..UHLWI...........3........0.....en0...1197

Internet6:
Destination........Gateway............Flags...........Netif Expire
::1................::1................UH................lo0
fe80::%lo0/64......fe80::1%lo0........Uc................lo0
fe80::1%lo0........link#1.............UHL...............lo0
ff01::/32..........::1................Um................lo0
ff02::/32..........::1................UmC...............lo0
5
  • 1
    Are you sure both your Mac and the proxy server are configured to forward communications through ports other than 80 (HTTP)? Also, did you configure the proxy on your browser or in the system preferences' network panel? Apr 28, 2011 at 2:37
  • I wouldn't know how to go about configuring either to forward communications to another port, unfortunately. This is a work computer (and of course what I am trying to do is work). The proxy is configured in my preferences' network panel, though. EDIT: I tried editing the proxy preferences in Safari, and it just redirected me to my computer's proxy settings, so it's definitely the network panel.
    – Nick
    Apr 28, 2011 at 2:54
  • A tech guy who's know-how stops at macs... oh the sad... Anyhow, have you tried not using the proxy? What happens when you don't use it? (or you can't circumvent it?) just as a testing scenario, see if you can try doing this with a VPN if you can't bypass the proxy. If you have success this means the problem is somewhere between the proxy's firewall and the mac terminal using some weird port configuration. If not, that means the problem is entirely somewhere in mac's terminal. Just to begin with, can this be done from a non-mac system just fine? (e.g. linux?)
    – Cestarian
    Apr 15, 2016 at 11:06
  • Wait what? question from 5 years ago?
    – Cestarian
    Apr 15, 2016 at 11:10
  • Just about every ever in the question comes down to DNS not resolving. Are you sure you have a working nameserver at 172.##.##.# ?
    – Hennes
    Apr 15, 2016 at 11:15

1 Answer 1

2

Do the following:

export http_proxy=http://<username>:<password>@<proxy_ip>:<proxy_port>

You may also HTTP proxy global configuration in Git, if needed:

git config --global http.proxy $http_proxy
3
  • Unfortunately it doesn't seem to be working :( Thank you though! That definitely seemed like it was going to work. (I tried both; if there were any problems with Git aside from what I assume is a global problem here, that smaller problem is likely fixed now :) )
    – Nick
    Apr 28, 2011 at 3:07
  • Sorry, but are you sure you are adding the proper proxy details? This has worked so many times for me!
    – manojlds
    Apr 28, 2011 at 3:18
  • It's very possible I'm not! I'll ask the tech guy the next time I'm in the office for exactly what I need to put in, and get back to you. For now, an upvote :) ...err, if I ever get 15 reputation, that is, apparently :P
    – Nick
    Apr 28, 2011 at 3:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .