You are not logged in.

#1 2023-09-01 22:26:02

BrianDMS
Member
From: Amsterdam, Netherlands
Registered: 2022-03-10
Posts: 14

[SOLVED] DNS issues when using systemd-networkd and systemd-resolved

Issue:
I'm not able to ping github.com, unless i specify https://www
Likely similar issues with other websites, seems like a DNS problem
reddit.com responds, but www.reddit.com, https://reddit.com or https://www.reddit.com do not
google.com responds, so does www.google.com, but https://google.com or https://www.google.com do not

Symptoms:

 
# ping github.com
ping: connect: Network is unreachable

# ping www.github.com
ping: connect: Network is unreachable

# ping https://github.com
ping: https://github.com: Name or service not known

# ping https://www.github.com
PING https://www.github.com(2606:50c0:8001::153) 56 data bytes
64 bytes from 2606:50c0:8001::153 icmp_seq=1 ttl=60 time=13.3 ms

Logs

# resolvectl status

Global
Protocols: +LLMNR +mDNS -DNSOverTLS DNSSEC=no/unsupported
resolv.conf mode: stub
Current DNS Server: 2620:fe::9#dns.quad9.net
Fallback DNS Servers: 1.1.1.1#cloudflare-dns.com 9.9.9.9#dns.quad9.net 8.8.8.8#dns.google 2606:4700:4700::1111#cloudflare-dns.com 2620:fe::9#dns.quad9.net 2001:4860:4860::8888#dns.google

Link 2 (enp1s0f1)
Current Scopes: none
Protocols: -DefaultRoute +LLMNR +mDNS -DNSOverTLS DNSSEC=no/unsupported

Link 4 (wlan0)
Current Scopes: LLMNR/IPv6 mDNS/IPv6
Protocols: -DefaultRoute +LLMNR +mDNS -DNSOverTLS DNSSEC=no/unsupported
# cat /etc/hosts

127.0.0.1    localhost
::1          localhost
127.0.1.1    arch-acer

Description
I did a fresh install with networkd+resolved network setup, i'm connected to a wireless network through iwd, other systems on the network work fine. This issue never happened to me on any of my other arch systems which use networkmanager instead.
I didn't change any networkd configuration, while for resolved i added /etc/resolv.conf as symlink to the recommended stub configuration, both systemd services are running, along with iwd. I don't have any firewalls of course.

This issue seems weird to me, since I thought having multiple fallbacks (which is supposed to be a default) on reputable DNS servers would prevent any such issues.
I found an old post mentioning this issue and saying they fixed it by adding 8.8.8.8 as the DNS in /etc/systemd/resolved.conf, which (besides not making much sense to me) breaks DNS completely for me, with ping reporting "Temporary failure in name resolution".
It seems like it's using an IPv6 DNS server by default, maybe that's related? This DNS is actually one of the fallbacks, but providing a regular DNS like 8.8.8.8 manually in resolved.conf does not fix the issue...


EDIT:
Actually... I cannot ping any DNS server when looking the IP up directly, e.g. 1.1.1.1 8.8.8.8 9.9.9.9 etc. only 0.0.0.0 works which is obviously local
Checked ip route and what do you know, i don't have one for IPv4, so that kinda explains everything, that's why it was falling back on some messy IPv6 DNS...

SOLUTION:
I'm so dumb, turns out networkd has to be configured to use DHCP, archwiki mentions the configuration of course but I somehow thought it's optional
I added 2 config files that fix the issue and enable DHCP for ether and wlan type connections, now everything works

Last edited by BrianDMS (2023-09-02 10:55:42)


alias ffs='sudo $(fc -ln -1)'

Offline

Board footer

Powered by FluxBB