0

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.com or resolvectl query 1.1.1.1.
  • ping 1.1.1.1 results in 100% packets transferred.
  • However, ping foo.com results 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.

Screenshot

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.

5
  • Doesn't 100% data loss means 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.) Commented May 29, 2024 at 3:50
  • Dear @TomYan, I do not think so. The expected behaviour is 0% data loss. Commented May 29, 2024 at 7:19
  • So what exactly do you see when you run the ping command? Can you add the full / verbatim output to your post? Commented May 29, 2024 at 7:29
  • 1
    @Centaro: I think the point was that you're skipping a few steps in your process. "0% packet loss" is not a DNS matter – such an expectation can only come after name resolution has been verified to work correctly, and after you've confirmed that the 'ping' command is trying to talk to the correct IP address. What you should be looking at is the first line of 'ping' output shows the IP address that it received from the system resolver – doesn't matter if the packet statistics say 0% or 100%, the numbers have no meaning until the address is confirmed to be right. Commented May 29, 2024 at 7:39
  • Dear @grawity_u1686, I have edited the question with your suggestions. So, it seems like it is resolving, but then getting no answer back. Commented May 29, 2024 at 17:50

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.