Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

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

WritingSolutions2020 November 10, 2017

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

0 votes
WritingSolutions2020 November 13, 2017

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...

Lars Olav Velle
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 13, 2017
WritingSolutions2020 November 13, 2017

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

Lars Olav Velle
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 13, 2017

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 

WritingSolutions2020 November 13, 2017

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

0 votes
Gonchik Tsymzhitov
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 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

0 votes
Lars Olav Velle
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 10, 2017

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.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events