Elm无法访问网络

问题描述

TL;DR:除了一个特定的二进制文件(在本例中为 elm)外,与网络相关的一切都运行良好。

我正在运行一台新的 Arch 机器 - 我通过 wifi 连接并可以访问网络。
但是 - 榆树似乎不知道这一点。尝试下载依赖项时,运行 elm make 会失败。 (这是从别处导入的项目)。

I Could not connect to https://package.elm-lang.org to get the latest list of
packages,and I was unable to verify your dependencies with the information I
have cached locally.

Are you able to connect to the internet? These dependencies may work once you
get access to the registry!

将 package.elm-lang.org 的 IP 添加到 /etc/hosts 修复了该问题,但随后会为 github.com 引发类似错误。我可以继续这样做,但肯定有办法说服榆树访问互联网。

我没有使用代理或类似的东西。我的连接显然有效并且看起来很稳定。 elm init 也因同样的原因失败,因此我无法在全新的目录上进行测试。

谢谢大家的帮助:)

解决方法

显然新的 arch 使用 systemd-resolved 守护进程作为 DNS,但 elm 决定直接读取 resolv.conf(这是空白),然后默认为 127.0.0.1 作为 DNS 服务器。

resolv.conf 中手动设置 DNS 服务器可以解决问题。