While working in WSL and git pull/push to git, I suddenly get the response
ssh: Could not resolve hostname bitbucket.org: Temporary failure in name resolution
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
When I couldn’t establish a connection to bitbucket.org through git in my WSL, I performed the following
dig a bitbucket.org
I got the following in the response (there’s more to the response, but this is the relevant part)
;; QUESTION SECTION:
;bitbucket.org. IN A
;; ANSWER SECTION:
bitbucket.org. 0 IN A 104.192.136.9
bitbucket.org. 0 IN A 104.192.136.7
bitbucket.org. 0 IN A 104.192.136.8
I rebooted my PC, restarted WSL and re-executed the dig-command supplied above and received as part of the response the following:
;; QUESTION SECTION:
;bitbucket.org. IN A
;; ANSWER SECTION:
bitbucket.org. 0 IN A 185.166.141.9
bitbucket.org. 0 IN A 185.166.141.7
bitbucket.org. 0 IN A 185.166.141.8
I didn’t expect the IP addresses to change
Why would the IP addresses change?
1
IPs can change when the server is relocated or for whatever other reason. Also, there’s the concept of DNS-Round-Robin, where the load on the servers is spread by redirecting clients to different IP addresses.
Most SaaS providers publish the relevant IP range, so that clients can update their firewall rules etc.
See here: https://support.atlassian.com/bitbucket-cloud/docs/what-are-the-bitbucket-cloud-ip-addresses-i-should-use-to-configure-my-corporate-firewall/
3