Home > OS >  Unable to access raw.githubusercontent.com
Unable to access raw.githubusercontent.com

Time:01-07

I want to download some files in github by raw.githubusercontent.com.

When using golang to implement this function, I encountered the following error:

dial tcp: lookup raw.githubusercontent.com: getaddrinfow: The requested name is valid, but no data of the requested type was found.

My code:

url1 := "https://raw.githubusercontent.com/pupillord/tiny-cs/main/README.md"

// the error mentioned above will appear here
resp, err := http.Get(url1)

Note: If I open it directly on the website, I can access the file normally.

CodePudding user response:

This error message is associated with the Winsock WSANO_DATA error code. It means, there is some problem with DNS record of the domain name you are trying to connect to.

See here : https://docs.microsoft.com/en-us/windows/win32/winsock/windows-sockets-error-codes-2#WSANO_DATA

  1. I think restarting server might fix it.
  2. you should investigate your environment's DNS settings
  3. If you manually entered the addres, make sure that the spelling is correct
  4. try entering the URL manually
  •  Tags:  
  • Related