0

The issue

Changing the DNS option in resolv.conf from the VM's gateway to 8.8.8.8 will result in no DNS resolution.

resolvectl query google.com succeeds if I set DNS to my gateway.

The set-up

  • /etc/resolv.conf is linked to stub-resolv.conf

  • systemd-networkd is configured as follows:

    [Match] Name=enp0s3 [Network] Address=192.168.0.222/24 Gateway=192.168.0.1 DNS=8.8.8.8 
  • /etc/systemd/resolv.conf has not been modified

enter image description here

Additional troubleshooting

  • I tried linking /etc/resolv.conf to /run/systemd/resolve/resolv.conf instead and only listing 8.8.8.8 as nameserver there. But systemd-resolved overwrites /run/systemd/resolve/resolv.conf

1 Answer 1

0

Changing the /etc/resolv.conf link to /run/systemd/resolve/resolv.conf and listing the DNS in /etc/systemd/network/foo.network and in /etc/systemd/resolved.conf made it so that the global and NIC settings listed by resolvectl point to 8.8.8.8 and succesfully resolve.

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.