Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

share|improve this question

migrated from stackoverflow.com Apr 28 '11 at 3:36

This question came from our site for professional and enthusiast programmers.

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? –  Julio Gorgé Apr 28 '11 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 '11 at 2:54

2 Answers 2

What happens when you ping your DNS server?

ping 172.###.###.###

And since I can already guess what's going to happen, can you also post the output of:

netstat -rn

It will be easier to troubleshoot if you don't anonymize your IP address. Also, you probably need to explain more about your setup. Is your proxy server on your local network? And why are you using a proxy? Why are you connecting through a proxy in the first place?

Edit:

That's not the answer I was expecting... you said this is affecting other computers? Try running

dig github.com 

and then

dig @8.8.8.8 github.com

to see if another DNS server (google's public DNS) is working correctly. If the first one fails and the second one succeeds, then you would know for sure if it's your local DNS server that is at fault. (Maybe your local server has a stale cache or some other configuration problem.)

Your netstat -rn looks normal, too.

share|improve this answer
    
Do you want my IP address or my DNS IP address? If you want the latter, it's 172.16.70.2. I can ping that address just fine. The output of the netstat -rn is going in my question. –  Nick Apr 29 '11 at 21:22
    
Also I'm using a proxy because I'm at work, as this is a work project. I'm not too keen on the workings of the setup of the internet here, unfortunately... –  Nick Apr 29 '11 at 21:40
    
I updated my answer... two more questions: are you able to get to github.com in your browser? And can you go to about:config in firefox and lookup the value of the variable named "network.proxy.socks_remote_dns"? –  mehaase May 1 '11 at 1:48

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
share|improve this answer
    
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 '11 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 '11 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 '11 at 3:22

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.