Ever since I repaired my EFI bootloader, Fedora 37 (and 38 now after upgrading) does not resolve DNS in the terminal.
Before I followed the Fedora Wiki’s guide, I unsuccessfully followed this guide to repair it:
and notably the section under Restore DNS - I’m not sure whether that’s relevant or not, but I still included it below.
Your network connection inside the chroot will probably not work as it should. While pings should work, sometimes DNS resolving does not work due to a broken / invalid /etc/resolv.conf. In my case, resolv.conf was an invalid symlink. I replaced it like this:
If you can ping to redhat.com and the IP address is displayed, DNS resolve did its job.
By the way, I get the same result for redhat. Not every site is willing to reply to pings, but google normally does, www.redhat.com works too.
Optimal current Fedora configuration is to have systemd-resolved up and running,
and /etc/resolv.conf should be a symlink to /run/systemd/resolve/stub-resolv.conf
This symlink is invalid if systemd-resolved is down for some reasons.
Check with “resolvectl” and “resolvectl query” the functionality, then it should be fine.
– Information acquired via protocol DNS in 95.3ms.
– Data is authenticated: no; Data was acquired via local or encrypted transport: no
– Data from: network
Now I understand. The procedure to fix grub is using chroot, where you run a Live-CD and descend by chroot into the actual system. At that moment, the actual system is not running systemd nor systemd-resolved and the /etc/resolv.conf symlink is broken, that’s why they recommend to make a normal /etc/resolv.conf pointing to 9.9.9.9
This is only during this chroot, if the system is running again you can recreate the symlink and continue as usual with Fedora standard config.
Now IPv6 and VPN enter the game… Do you have a VPN supporting IPv6? There seem to be not that many. Some VPN’s send IPv6 into the blackhole of a dummy interface which means that any attempt to ping a host via IPv6 will fail. You can check with “ip -6 route get” followed by the IPv6 address of the host you want to check to see the direction the packets go and the source address used.