0

TL;DR: Everything network-related is working perfectly except one specific binary (in this case - elm).

I am running a new arch machine - I am connected via wifi and have networks access.
However - elm does not seem to know that. Running elm make fails when it tries to download the dependencies. (This is a project imported from somewhere else).

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!

Adding the IP of package.elm-lang.org to /etc/hosts fixes that, but it then throws a similar error for github.com. I can keep doing that, but surely there is a way to convince elm to access the internet.

I'm not using a proxy or anything like that. My connection obviously works and seem stable. elm init also fails for the same reasons so i'm unable to test on a brand new directory.

Thank you all for your help :)

Ash42
  • 73
  • 1
  • 7
  • 2
    I don't think this is a problem with Elm - it seems that for some reason on your computer running programs in the console (or where ever you run this) don't resolve the Hostnames - maybe you have an issue with your DNS? Does something like `npm` or `git` work (for example does `mkdir Test && cd Test && npm init -y && npm install --save-dev elm` work? – Random Dev Jun 05 '21 at 07:09
  • DNS works fine in every other program (in the terminal and everywhere else) – Ash42 Jun 05 '21 at 09:10
  • 1
    Downvoted. This is a configuration question, not a programming question. –  Jun 07 '21 at 22:46

1 Answers1

4

Apparently fresh arch uses the systemd-resolved daemon for DNS, but elm decides to just read resolv.conf directly (which is blank), and then defaults to 127.0.0.1 as the DNS server.

Setting a DNS server manually in resolv.conf did the trick.

Ash42
  • 73
  • 1
  • 7
  • glad you could find it - and many thanks for sharing the solution - it's probably gonna effect more Arch users I think – Random Dev Jun 08 '21 at 04:17
  • 1
    /etc/resolv.conf should not be blank even when using systemd-resolved. You may want to review https://wiki.archlinux.org/title/Systemd-resolved to complete your installation. Do note that by editing resolv.conf manually you change the way systemd-resolved behaves (it will go into client mode). You need to either symlink the systemd-resolved generated resolv.conf to /etc/resolv.conf or use some other daemon to manage your resolv.conf. – voneiden Jun 15 '21 at 09:49