The question
- Systemd-networkd succesfully requests an IP address for my computer and routes its traffic to and from the gateway as expected.
- Systemd-resolved can correctly resolve FQDNs and IP addresses with
resolvectl query foo.comorresolvectl query 1.1.1.1. ping 1.1.1.1results in 100% packets transferred.- However,
ping foo.comresults in 100% of packets transmitted, 0% received, 100% packet loss.
Any ideas as to why? The expected behaviour would be 100% packets transferred. It seems to be resolving, but the answers are not getting back.
The set-up
- /etc/systemd/network/enp0s3.network with:
[Match]
Name=enp0s3
[Network]
Address=192.168.0.222/24
Gateway=192.168.0.1
DNS=192.168.0.1
- resolv.conf -> ../run/systemd/resolve/stub-resolv.conf with:
nameserver 127.0.0.53
options edns0 trust-ad
search .
- /etc/systemd/resolved.conf.d/dns_servers.conf with:
[Resolve]
DNS=192.168.35.1
nameserver 2001:730:3ed2::53
nameserver 2001:730:3ed2:1000::53
I am willing to swear I set up DNS to 192.168.0.1 and it got dynamically edited.

100% data lossmeans that ping did get an answer from the resolver? Didn't you see the IP in its output? I don't think the problem has anything to do with name resolution? (Unless you are talking about like "foo.com" got resolved to a wrong IP.)