Getting error could not resolve hostname for github enterprise

2.3k views Asked by At

When I trying to clone github repositories from my company's self hosted github enterprise

I am getting error

Could not resolve hostname github....... : Name or service not known

But when I clone the same repo using the IP address I can do the same and I am even able to ping the github..... from command line.

I am using :

GIT version : git version 2.14.1.windows.1
Windows 10 enterprise version version: 1607 OS build: 14393

I have checked others with similar machine are not facing this issue

Can someone please help me with this issue.

2

There are 2 answers

0
warl0ck On BEST ANSWER

I found the issue, so while installing Git the installer asks if I want to use the certificates installed on my Local Machine to which earlier said no.

But after re-installing the Git, I selected this option and since that Github's certificate was installed on my machine by my company it was working fine.

1
Al Neill On

I would add a host entry on my windows machine that defines the github address to the IP address you need to use.

Here is one procedure that describes how it works. Basically you edit the hosts file as administrator , it is located in an out of the way dir c:\Windows\System32\Drivers\etc\hosts

(I havent done it myself for windows 10)

https://support.rackspace.com/how-to/modify-your-hosts-file/

Of course this may not be available option to you depending on your local Infosec policies/enforcement