# strange name resolution problem

## fpemud

The hostname of my PC is fpemud-workstation.

I can't remember when this problem starts:

```
fpemud-workstation repo-fpemud-overlay-private # git pull

fatal: unable to access 'https://fpemud@fpemud-workstation:9420/fpemud-overlay-private.git/': Could not resolve: fpemud-workstation (Domain name not found)

```

But:

```
fpemud-workstation repo-fpemud-overlay-private # ping fpemud-workstation

PING fpemud-workstation (192.168.1.101) 56(84) bytes of data.

64 bytes from fpemud-workstation (192.168.1.101): icmp_seq=1 ttl=64 time=0.043 ms

^C

--- fpemud-workstation ping statistics ---

1 packets transmitted, 1 received, 0% packet loss, time 0ms

rtt min/avg/max/mdev = 0.043/0.043/0.043/0.000 ms

```

```
fpemud-workstation repo-fpemud-overlay-private # ftp fpemud-workstation

Connected to fpemud-workstation.

220 (vsFTPd 3.0.2)

Name (fpemud-workstation:fpemud): anonymous

530 Please login with USER and PASS.

530 Please login with USER and PASS.

SSL not available

230 Login successful.

Remote system type is UNIX.

Using binary mode to transfer files.

ftp> quit

221 Goodbye.

```

I think it is because git uses curl:

```
fpemud-workstation repo-fpemud-overlay-private # curl fpemud-workstation:9420

curl: (6) Could not resolve: fpemud-workstation (Domain name not found)

fpemud-workstation repo-fpemud-overlay-private # curl fpemud-workstation

curl: (6) Could not resolve: fpemud-workstation (Domain name not found)

```

And my git config:

```
fpemud-workstation repo-fpemud-overlay-private # git config -l

user.name=fpemud

user.email=fpemud@sina.com

core.repositoryformatversion=0

core.filemode=true

core.bare=false

core.logallrefupdates=true

remote.origin.url=https://fpemud@fpemud-workstation:9420/fpemud-overlay-private.git

remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*

branch.master.remote=origin

branch.master.merge=refs/heads/master

http.sslverify=false

```

curl to another host is ok:

```
fpemud-workstation repo-fpemud-overlay-private # curl www.google.com.hk

<!doctype html><html itemscope="" itemtype="http://schema.org/WebPage" lang="zh-HK"><head><meta

...

```

git to another host is ok either:

```
[fpemud@fpemud-workstation ~/codes]$ git clone https://github.com/FreeRDP/FreeRDP

Cloning into 'FreeRDP'...

remote: Counting objects: 63576, done.

remote: Compressing objects: 100% (48/48), done.

Receiving objects:   4% (2647/63576), 508.00 KiB | 127.00 KiB/s   

```

Really strange. Please anyone can enlighten me?

----------

## nativemad

Hi,

it seems that curl would need the --resolve flag to respect /etc/hosts correctly. But I don't know how to do that withing a git config!?

Another way would be adding that hostname to your local DNS-zone on the DNS server.

Or you could just use 127.0.0.1 as address i guess.

HTH, cheers

----------

## Hu

Why are you using https to access localhost?  Is the repository not directly readable due to permissions?

----------

