Im using a linux ubuntu 20.10 server (bare metal server on OVH) and have jenkins installed on it. I keep getting java.net.UnknownHostException: updates.jenkins.io
or
java.net.UnknownHostException: get.jenkins.io
when trying to install plugins using the jenkins ui. The strange thing is it works occasionally after multiple attempts but most of the time the installation fails with java.net.UnknownHostException
. I also get Failed to resolve host name updates.jenkins.io. Perhaps you need to configure HTTP proxy?
in some cases. I assume it has the same underlying issue as the other exceptions. However i could successfully curl updates.jenkins.io.
I couldn't find anything useful on the internet. Some suggested to look into the DNS configuration but i dont know what i should be looking for exactly. There is only 1 entry in the /etc/resolv.conf
nameserver 213.186.33.99
.
I solved the problem by following this anwser: [https://unix.stackexchange.com/questions/71551/could-not-resolve-host-error][1]
Basically i added these lines to /etc/resolv.conf. `
nameserver 208.67.222.222
nameserver 208.67.220.220
nameserver 8.8.8.8
nameserver 8.8.4.4
Apparently the standard dns server provided by ovh server doesn't work correctly.