0

I've just installed Arch. My computer is connected to my router/modem via Ethernet cable.

I just logged in and tried using pacman to install a package but got a bunch of "could not resolve host" errors.

enter image description here

When I run ping google.com it sometimes works but other times gives this error: Temporary failure in name resolution.

Output of ip addr enter image description here

Contents of /etc/resolv.conf enter image description here

7
  • 1
    It's clear you have DNS issues. Check /etc/resolv.conf. It not that, then I would say you have no network setup.
    – Bib
    Dec 17, 2021 at 16:27
  • Use Server = http://166.78.229.131/archlinux/$repo/os/$arch to check if it is DNS issue. This is the mirror name mirror.rackspace.com Dec 17, 2021 at 16:52
  • @Bib What should I be looking for in that file? It exists and I will add to my question the contents of it.
    – Username
    Dec 20, 2021 at 23:25
  • @AbdullahIbnFulan Can you tell me, step by step, what you're asking me to do? I tried typing your idea in command line and got "Server: command not found" error.
    – Username
    Dec 20, 2021 at 23:27
  • Please don't post images of text.
    – Jim L.
    Dec 21, 2021 at 4:07

4 Answers 4

2
+200

It looks like you have both dhcpcd and network-manager installed. Having two packages to manage your network causes conflicts. Try uninstalling one of them.

8
  • I added that line to the bottom of the file but still get the same error when running ping google.com
    – Username
    Dec 20, 2021 at 23:56
  • Check if you have your hostname set up(/etc/hostname)
    – Gagan
    Dec 20, 2021 at 23:58
  • Also try ip addr to check if your interface is up.
    – Gagan
    Dec 21, 2021 at 0:03
  • I have the name in /etc/hostname, though when I run hostname in terminal it says "command not found"
    – Username
    Dec 21, 2021 at 0:03
  • I added the output of ‘ip addr’
    – Username
    Dec 21, 2021 at 0:08
1

In my case, the cause of this problem is that systemd-resolved wasn't running(inactive). So try to check its status first:

systemctl status systemd-resolved

If you see that the value of Active field is inactive, you need to start it:

systemctl start systemd-resolved
1
  • this was the one that worked for me, thanks! Jan 27 at 6:02
0

According ip addr, it appears you have not connected and authenticated to a wireless network yet.

Use iwctl to connect to a network:

iwctl --passphrase <passphrase> station wlp1s0 connect <SSID>
6
  • I will try this. But why won't my internet work even when connected to my modem via Ethernet cable?
    – Username
    Dec 21, 2021 at 0:18
  • @Username there could be a driver problem since your Ethernet device does not show up in ip. You can check dmesg to see if there are any errors. If there isn't anything, you should check your BIOS settings to make sure Ethernet isn't disabled.
    – Snake
    Dec 21, 2021 at 0:27
  • I just realized I accidentally unplugged the Ethernet cable. I plugged it back in and edited my question with the correct ip addr output. Still getting the same errors though.
    – Username
    Dec 21, 2021 at 0:28
  • @Username could be a DHCP issue as your Ethernet device is not being assigned an IP address by your router. Check your router settings if DHCP is correctly setup and if any other connected computers are being assigned IP addresses.
    – Snake
    Dec 21, 2021 at 0:41
  • 1
    @Username I see that you have two DHCP clients running (dhcpcd and NetworkManager). This can cause conflicts so only one should be running. Disable dhcpcd: sudo systemctl disable --now dhcpcd.service
    – Snake
    Dec 21, 2021 at 0:50
0

My particular issue was not having installed linux-firmware before rebooting without the flash ISO. The wireless device was missing altogether from ip addr. The solution was to :

  1. Boot from the arch iso.
  2. Use iwctl to connect to the wireless network
  3. After having installed a working network connection arch-chroot into my installation (mount it again if needed).
  4. pacman -S linux-firmware

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .