I was attempting to clone a github repo on a Slicehost account and received the error below. Its possible that github.com recently updated DNS so if this happens to you then you can use the temporary fix I located on github’s twitter account.
Error:fatal: Unable to look up github.com (port 9418) (Name or service not known)
This error was caused by attempting to clone edavis10’s redmine repo using the command below.
- git clone git://github.com/edavis10/redmine.git
To resolve this issue add the following line to /etc/hosts on your Linux server.
- 65.74.177.129 github.com wiki.github.com gist.github.com assets0.github.com assets1.github.com assets2.github.com assets3.github.com
Make sure to remove this line once DNS is working again from your server.
Dear Alex:
Thank you HUGELY for this post. After looking in many places trying to get tunnelling to work and doing ‘this’ and ‘that’ your simple suggestion instantly fixed our project and helped put us back on timeline. Thank you, again!
Best,
Pyrrhic
Hello Pyrrhic,
Glad it helped. Its always nice to have feedback lik e this. We do write all of these articles for free and accept donations if you feel the article went above and beyonod toss a dollar in our PayPal account… link located at the top of every page right below the navigation. Regardless of if you are able to do so or not we will continue to write as many articles as we can and we will continue to feed off of positive feedback such as your comment above.
Thanks.
Alex
hai ,
what should i do if i am on windows
Hello manoj,
Add a similar line to the “hosts” file on your Windows server. The exact location varies on the Windows OS version such as Windows 7, Windows Vista, Windows XP, Windows Server 2003, etc. You should be able to track that information down on the Internet though without issue.
Thanks.
alex
Hi Alex,
I have created a git repository and i’m trying to clone it using the command :
git clone git://home/repo_evm/harsha
Below is the error that is getting displayed.
Initialized empty Git repository in /home/sriharsha/.git/
fatal: Unable to look up home (port 9418) (Name or service not known)
Any help would be appreciative.
Regards,
SriHarsha
Hello Harsha,
This is a bit different than what the article content is about however I believe I can provide some useful information. Try the below command instead if the repo is on the same server you are cloning to but if not just change localhost to the IP address of the machine you are cloning from…
git clone user@localhost:/home/repo_evm/harsha
You will also need to change the “user” in the above command to the proper user that owns the repo.
Hope that helps.
Thanks.
alex
Hi Alex,
Thank you for the prompt help.
Regards,
N.S.SriHarsha
Hello Harasha,
No problem. Thanks for taking the time to follow up and leave feedback.
Thanks.
alex
Hi,
It does not work. When I modified /etc/hosts and sourced it, I get the following:
65.74.177.129: command not found
And the cloning fails.
_Sandip
Hello Sandip,
This article was written more than 2 years ago so it is possible they have changed the IP address. You might try doing a nslookup or dig with the domain you are connecting to. It is also possible there is something else blocking the traffic between you and github.
Thanks.
alex
thanks for the post
But i hv another error that after doing the above steps im getting the following error now
Initialized empty Git repository in /home/idris-outdoor/libfreenect/.git/
github.com[0: 65.74.177.129]: errno=Connection refused
fatal: unable to connect a socket (Connection refused)
thanks in advance
Hello maarige,
Looks like you do not have github configured properly as it is refusing your connection. Follow the steps to generate and configure SSH keys.
Thanks.
alex
Hi Alex,
I am able to run GIT Clone command, but on running Git submodule update I get this error:
“Cloning into ‘src/main/webapp/sdk’…
fatal: Unable to look up github.com (port 9418) (No such host is known. )
Clone of ‘git://github.com/forcedotcom/SalesforceCanvasJavascriptSDK.git’ into s
ubmodule path ‘src/main/webapp/sdk’ failed”.
I am running on windows and accessing web through a proxy.
Thanks in advance.
Regards,
Bikash