I was having this exact problem also: I found this thread and was able to fix it.
I've cut and pasted the relevent discussion (contained in the thread above) below.
If you were using a proxy server you would probably know about it so we'll proceed on the assumption that no proxy configuration is required.
This error is caused by selecting the "Manual proxy configuration" radio button in the Arduino IDE preferences. The solution to the error is to disable the proxy configuration in the IDE. Unfortunately there is a bug in Arduino IDE 2.x that makes it impossible to use the Arduino IDE GUI set the preference back to "No proxy" after you have set it to "Manual proxy configuration". So you must edit the preferences file directly.
I'll provide instructions for doing that:
Select File > Quit from the Arduino IDE menus if it is running.
Use any text editor to open the file at the following path:
C:\Users\<username>\.arduinoIDE\arduino-cli.yaml
Delete the line from the file that looks like this:
proxy: http://_/
Save the file.
Start the Arduino IDE.
Now try installing the "ArduinoJson" library again. You should now no longer encounter that see that "proxyconnect tcp: dial tcp: lookup _: no such host" error.
Please let me know if you have any questions or problems while following those instructions.