Git / Linux can't resolve bitbucket.org, needs numeric IP address instead... Edited

For Linux Mint 18, Git command line, Bitbucket repository.

I have a remote Bitbucket repository that works fine on Windows 7. Today I've been trying to set up the same repo on Linux (Mint 18).

I tested the setup of my SSH certificates, et cetera. So far, so good, I think:

$ git remote -v
origin    ssh://git@bitbucket.org:[bitbucketUserName/RepoName].git (fetch)
origin    ssh://git@bitbucket.org:[bitbucketUserName/RepoName].git (push)

But IF I try to to pull from / push to that remote repository, THEN I receive the following message:

ssh: Could not resolve hostname bitbucket.org:[bitBucket/UserName/RepoName] Name or service not known
Fatal: Could not read from remote repository

SO I used ping to get the IP address of bitbucket.org, then inserted that IP address in the following command:

git push git@104.192.143.2:[bitBucketUserName/repoName].git

After a "continue?" prompt, git connected to the repo. (I was then told, correctly, that everything was up to date.)

WHY doesn't bitbucket.org work but an IP address does? How do I fix this?

Cheers & thanks,
Riley SFO

3 answers

The problem is not with bitbucket.org, but your linux machine. You need to fix DNS.

I´m not familiar with mint, but have a look at the network config.

0 votes
Gonchik Tsymzhitov Community Champion Nov 10, 2017

Hi! 

Please, fix dns configuration.

better way check in the terminal: 

cat resolv.conf 

kindly you can add it 8.8.8.8 if your provider get possibility. (another place on the interface level  cat /etc/network/interfaces)

how to check work is it? it is easy.

nslookup bitbucket.org 8.8.8.8

nslookup bitbucket.org

 

After you will see a root cause.

 

You can read this artciles:

https://tecadmin.net/setup-network-interface-on-ubuntu-debian-and-linuxmint/

or video gui way for configuration

https://www.youtube.com/watch?v=0EwlThnVf1E

 

Cheers,

Gonchik Tsymzhitov

Thanks -- but so far none of the replies have answered the question. Evidently I need to do something with my Linux computer's DNS configuration but I have no idea what, exactly.

I appreciate the attempts to help. But I'm still looking for a complete and accurate answer...

Thanks.  I tried commenting out the line in  NetworkManager.conf as described in that article but it hasn't worked. A commentor stated that a reboot wasn't necessary to apply the changes. I'll circle back after I reboot tomorrow if that happens to resolve the issue.

I can still push/pull if I specify BitBucket's IP address. So for now I've simply scripted push/pull commands that include Bitbucket's IP address.  (These sorts Linux "aren't we clever" problems are the reason that Linux has never gained acceptance on the desktop -- what user wants to be obliged to remediate these sorts of idiocies?)

Cheers & thanks 'gain,
Riley
SFO

Well, I agree that you shouldn't have to battle DNS problems, but these appear on windows as well :-)

A reboot would probably not fix the issue. Restarting network might though.

Also, Linux Mint was compromised earlier this year. 

https://superuser.com/questions/1043479/linix-mint-live-cd-dns-not-working-but-will-ping-out-fine 

Thanks again. Happily the briefly misdirected version of Mint Linux was 17.3 and I'm running version 18. (I also recall seeing that news when it occurred and being happy that I hadn't downloaded Mint on 20 February, 2016.)

In the meantime I'm moving on. I've circumvented the issue with scripts that use Bitbucket's IP address to push/pull. Not ideal but it works and I can go back to doing useful work rather than baby sitting Linux / Bitbucket. (Never had this problem with Git on Windows 7 pushing/pulling to/from BitBucket. And don't have a problem pushing/pulling from this Linux computer to/from Github...)

Cheers & thx again,
Riley
SFO

Suggest an answer

Log in or Join to answer

Stay in touch

Be the first to know what's trending on Atlassian Community