Toolchain installation error "dns error: failed to lookup address information: Temporary failure in name resolution"

I had a problem installing rustup due to curl certificate error. Thus had to download and install the file manually taking help from this thread
Now that rustup is installed, I want to install nightly toolchain but running in dns problem.

Here is the problem. I am using the command

rustup toolchain install nightly

and getting network error

> info: syncing channel updates for 'nightly-armv7-unknown-linux-gnueabihf'
error: could not download file from 'https://static.rust-lang.org/dist/channel-rust-nightly.toml.sha256' to '/root/.rustup/tmp/6_tjfa8_sjm_e_6c_file': failed to make network request: error sending request for url (https://static.rust-lang.org/dist/channel-rust-nightly.toml.sha256): error trying to connect: dns error: failed to lookup address information: Temporary failure in name resolution: error trying to connect: dns error: failed to lookup address information: Temporary failure in name resolution: dns error: failed to lookup address information: Temporary failure in name resolution: failed to lookup address information: Temporary failure in name resolution

Have successfully pinged static.rust-lang.org from terminal.

Have also downloaded the channel-rust-nightly.toml from browser.

rustup update is also giving the same network problem.

What happens if you try to curl https://static.rust-lang.org/dist/channel-rust-nightly.toml.sha256? Do you see the hash? I get this in my console:

> curl https://static.rust-lang.org/dist/channel-rust-nightly.toml.sha256
c5da8dd4ed8ef4627e260fc6b1d8f61eb6b528540842902ee2f19ccd206c2c3a  channel-rust-nightly.toml

I get the certificate error.

>curl https://static.rust-lang.org/dist/channel-rust-nightly.toml.sha256
curl: (60) SSL certificate problem: unable to get local issuer certificate
More details here: https://curl.haxx.se/docs/sslcerts.html

curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.

That's why I had to download manually.

Maybe it's a system problem?

I had problems with name resolution in Rust once when I wanted to use the DNS server of my VPN as a fallback for my local DNS. Curl worked fine, the version of trust-dns used by my Rust program did not. What I want to say is that maybe you have complex DNS configuration on your machine the DNS resolver of rustup can't handle? In my case I had to change the /etc/resolv.conf by hand to make my Rust program work when I'm connected to my VPN.

AFAICT the default download backend for rustup is reqwest (see here). The default dns resolver of reqwest ist hyper's GaiResolver (optionally you can enable trust-dns as an alternative resolver). Maybe the GaiResolver has trouble parsing your /etc/resolv.conf file correctly (I don't know how Windows or MacOS do DNS resolution)? Given that you already have issues with local certificates, I have the suspicion that your network configuration has some issues that may effect rustup's DNS resolver.

I am not using VPN and nothing special with dns configuration on this raspi with raspup (puppylinux for raspi). Using a plain simple direct connection on this one. So there is nothing to configure.
Yes I have certificate issues with curl, despite having the latest certs installed.
And thanks for the libraries. I'll look through them. Meanwhile if something clicks, please notify.

Is there a way I can execute the downloaded nightly.toml file, to install the nightly toolchain?

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.