Troubleshooting Git & Network Issues: When Browsing Works but Ping/Git Fails Behind Corporate Firewall


2 views

Many developers working behind corporate firewalls encounter this puzzling scenario:

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

While your browser happily loads the same domain, command-line tools like ping and git fail to resolve hostnames. This typically indicates a split DNS configuration or firewall restrictions on your corporate network.

First, let's verify the symptoms with these commands:

# Check basic DNS resolution
nslookup someserver.org
ping someserver.org

# Test git specifically
git ls-remote git://someserver.org/repo.git

If these fail while browser access works, we're dealing with one of these scenarios:

  • Corporate proxy intercepting HTTP/HTTPS but not other protocols
  • Firewall blocking non-web ports (like git's 9418)
  • Different DNS servers for different applications

1. Using SSH Instead of Git Protocol

Many corporate networks allow SSH (port 22) while blocking git:// (port 9418):

git clone ssh://git@someserver.org:repo.git
# Or for GitHub-like services:
git clone git@github.com:user/repo.git

2. Configuring Git to Use HTTPS

Force git to use the web protocol which bypasses the restriction:

git config --global url."https://".insteadOf git://
git config --global url."https://github.com/".insteadOf git@github.com:

3. Custom DNS Resolution

If DNS is the issue, try overriding system DNS:

# Linux/macOS
sudo vim /etc/resolv.conf
# Add: nameserver 8.8.8.8

# Windows (Admin PowerShell)
Set-DnsClientServerAddress -InterfaceIndex 12 -ServerAddresses 8.8.8.8,8.8.4.4

4. Proxy Configuration for Git

If your company uses a web proxy:

git config --global http.proxy http://proxy.example.com:8080
git config --global https.proxy https://proxy.example.com:8080

For strict networks, create an SSH tunnel to an external server:

ssh -L 9418:someserver.org:9418 user@external-server.com
# Then locally:
git clone git://localhost/repo.git

These commands help identify network issues:

# Check DNS resolution
dig someserver.org
host someserver.org

# Check port accessibility
telnet someserver.org 9418
nc -zv someserver.org 9418

# Trace network path
traceroute someserver.org
pathping someserver.org

Remember that corporate IT policies exist for security reasons. Always check with your network administrators before implementing workarounds.


When working behind corporate networks, you might encounter a situation where your browser can access a Git server (like GitHub or Bitbucket) while command-line tools fail with errors like:

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

This typically indicates DNS resolution issues specific to non-browser applications.

First, let's verify the symptoms:

# Basic connectivity tests
ping someserver.org          # Fails
nslookup someserver.org      # Fails
curl https://someserver.org  # Works in browser but fails in CLI

This behavior usually stems from:

  • HTTP proxy configurations affecting only browser traffic
  • Split DNS configurations where internal/external lookups differ
  • Firewall rules blocking non-web ports (like Git's 9418)
  • Different DNS servers being used by browser vs system

Solution 1: Configure Git to Use HTTPS Instead of SSH

git config --global url."https://".insteadOf git://
git config --global url."https://github.com/".insteadOf git@github.com:

Solution 2: Override DNS Resolution

Find the IP address through your browser (using developer tools) and add it to your hosts file:

# Linux/Mac
echo "123.45.67.89 someserver.org" | sudo tee -a /etc/hosts

# Windows (Run as Administrator)
Add-Content -Path $env:windir\System32\drivers\etc\hosts -Value "123.45.67.89 someserver.org"

Solution 3: Configure System-Wide Proxy

# Linux
export http_proxy=http://corporate.proxy:8080
export https_proxy=http://corporate.proxy:8080

# Windows
netsh winhttp set proxy corporate.proxy:8080

Solution 4: Use SSH Config Bypass

# ~/.ssh/config
Host github.com
    Hostname ssh.github.com
    Port 443
    User git

After applying any solution, test with:

git ls-remote https://someserver.org/repo.git
# or
ssh -T git@someserver.org