68 votes
Accepted

How to configure systemd-resolved and systemd-networkd to use local DNS server for resolving local domains and remote DNS server for remote domains?

In the configuration file for local network interface (a file matching the name pattern /etc/systemd/network/*.network) we have to either specify we want to obtain local DNS server address from DHCP ...
user avatar
26 votes

Override Ubuntu 20.04 DNS using systemd-resolved

Update /etc/systemd/resolved.conf [Resolve] DNS=1.1.1.1 8.8.8.8 FallbackDNS=8.8.4.4 Restart system resolved: service systemd-resolved restart Run systemd-resolve --status the output should look ...
user avatar
  • 2,374
20 votes

What are DNS server, resolver and stub resolver?

Confusing names that people often get wrong. In the terminology of RFC 1034, there are "resolvers" and there are "name servers". "resolver" describes the entire subsystem ...
user avatar
  • 62.9k
17 votes

How to configure systemd-resolved for mdns multicast dns on local network?

This is a late answer but I still think that can help someone because there are few infos on this topic. I also wasted time on this problem. Changing the /etc/systemd/resolved.conf is just a part of ...
user avatar
  • 271
13 votes

How to allow systemd-resolved to listen to an interface other than loopback?

You can't. As cristian-rodríguez mentioned above, it was strictly designed to provide services to loopback only. Not even an alternative solution using net.ipv4.conf.all.route_localnet=1 + iptables ...
user avatar
  • 131
13 votes

How to allow systemd-resolved to listen to an interface other than loopback?

Resolved is not intended nor designed for your use-case, but to provide services in the local loopback, thus the listen address is hardcoded.
user avatar
12 votes

What is the difference between resolvconf, systemd-resolve, and avahi?

When you run a command such as ping foobar the system needs to work out how to convert foobar to an ip address. Typically the first place it looks is /etc/nsswitch.conf. This might have a line such as:...
user avatar
10 votes
Accepted

Why doesn't systemd-resolved use my local DNS server?

So, changing my wired eth0 interface to be managed solved this issue for me. Changing ifupdown to managed=true in /etc/NetworkManager/NetworkManager.conf [ifupdown] managed=true Then restart ...
user avatar
  • 369
9 votes

Why doesn't systemd-resolved use my local DNS server?

My guess is that your systemd-resolved service is configured correctly, but it never gets to see the request. The .local domain is treated specially by systems running mDNS. avahi-daemon, which ...
user avatar
  • 3,792
8 votes

What's the difference between /run/systemd/resolve/stub-resolv.conf and /run/systemd/resolve/resolv.conf?

Using resolv.conf instead of stub-resolv.conf will bypass a lot of systemd-resolved configuration, such as DNS answer caching, per-interface DNS configuration, DNSSec enforcement, etc. Explanations: ...
user avatar
  • 286
7 votes

How to configure systemd-resolved for mdns multicast dns on local network?

In order to enable mDNS on an interface, you need to set the MulticastDNS= option in the [Network] section of the .network file for the interface in the 10.0.0.0/16 network. This option defaults to ...
user avatar
  • 19.8k
7 votes

How to make systemd-resolved stop trying to use offline DNS servers?

DNS professionals have known for long that if you want DNS service resiliency in any network, you do not leave that decision up to the client implementation. It is a too important decision, to leave ...
user avatar
7 votes
Accepted

Why is my stub-resolve.conf missing?

Sorry, i am late to the party, but maybe this will help others. I had the same problem, and actually, the /run/systemd/resolv directory was missing. Then I realized that systemd-resolved.service was ...
user avatar
  • 109
6 votes

How to configure systemd-resolved for mdns multicast dns on local network?

I spent a lot of time trying to get system-resolve working persistently after reboot, but couldn't get it to work to great frustration. The steps I took as per instructions and comments above: Set ...
user avatar
  • 161
6 votes

How to allow systemd-resolved to listen to an interface other than loopback?

Exactly the desired configuration of listen-addresses is freely possible since systemd-resolved version 247 (commit 1f05101f and follow-ups) by setting DNSStubListenerExtra. Address, port, and ...
user avatar
  • 161
6 votes

How to configure systemd-resolved and systemd-networkd to use local DNS server for resolving local domains and remote DNS server for remote domains?

Just to expand on @piotrDobrogost 's excellent answer, don't forget to config /etc/nsswitch.conf to use systemd-resolved as a DNS resolution source. Your hosts directive should look as follows for ...
user avatar
  • 1,981
5 votes
Accepted

dnsmasq & systemd Causing Intermittent CPU Spikes

It looks like you may have dnsmasq process in 127.0.0.1 and systemd-resolved process in 127.0.0.53 passing queries back and forth between each other, causing a loop. Even dnsmasq alone might be ...
user avatar
  • 70.9k
4 votes
Accepted

systemd version 219 from CentOS 7 listening on random UDP port

As I mentioned in a comment to the question, I ran systemd-resolved in strace, while watch[ing] netstat -tunlp. I noticed that the port is only opened once I make the first request to resolve a DNS ...
user avatar
4 votes

What are DNS server, resolver and stub resolver?

As long as systemd-resolved is concerned, 'stub-resolver' doesn't do all the DNS resolution on it's own(i.e. it doesn't connect to root DNS servers -> tld/gtld name servers -> authoritative name ...
user avatar
4 votes

Where is that 1.1.1.1 NS coming from?

After reading the comment from @muru, went to check the /etc/systemd/resolved.conf file, that I missed... and [Resolve] DNS=1.0.0.1 1.1.1.1 #FallbackDNS= found the culprit! I probably set it long ago,...
user avatar
  • 602
3 votes

Arch Linux resolving issues

I have a similar problem after archlinuxarm updates: some sites works but most of them are unavailable and pacman cannot updates. In my case the problem is dnssec on system resolver. It may be ...
user avatar
  • 31
3 votes

How to configure systemd-resolved and systemd-networkd to use local DNS server for resolving local domains and remote DNS server for remote domains?

If you are doing this because you have an connection configured with OpenVPN, you need to use https://github.com/jonathanio/update-systemd-resolved as per https://wiki.archlinux.org/index.php/OpenVPN#...
user avatar
  • 131
3 votes
Accepted

Clarifying four modes of handling /etc/resolv.conf in systemd-resolved

My guess is that you are getting your IP configuration from DHCP, which overrides the DNS information in your resolved.conf file (from systemd.network(5)): [DHCP] SECTION OPTIONS [...] ...
user avatar
  • 3,792
3 votes

What is the recommended way to set a global DNS server override on a system using systemd-resolved?

I miss the days when was easy to manage nameservers, just editing /etc/resolv.conf. While this actually still works, now distros like Ubuntu add services that symlink and manage /etc/resolv.conf ...
user avatar
  • 331
3 votes

How do you remove bad DNS server IPs from systemd-resolved?

You may use this command: sudo systemd-resolve --flush-caches or sudo resolvectl flush-caches (latter command taken from the man page of systemd-resolve) To verify that flush was sucessfull, use: ...
user avatar
  • 3,745
2 votes

Default DNS server settings

In order to close this thread i will answer all my questions on the off chance that somebody in my situation comes across this post. "I was under the impression, that usually a DNS request is sent to ...
user avatar
2 votes
Accepted

How to understand and mitigate the Evil DNS remote attack under linux systems?

As per the Ubuntu security notice, the issue only affects systemd-resolved (this can be confirmed by looking at the patch fixing the issue). So a system which isn’t running systemd-resolved isn’t ...
user avatar
2 votes

How to configure systemd-resolved for mdns multicast dns on local network?

In addition to MulticastDNS=yes in your .network file, the same setting also needs to be set in resolved.conf. From resolved.conf doc: Multicast DNS will be enabled on a link only if the per-link ...
user avatar
  • 477
2 votes

systemd-resolved block a domain name

Adding an entry to /etc/hosts is supposed to work and in my tests it worked as expected. My tests are on Fedora Rawhide, with version systemd-239-9.git9f3aed1.fc30.x86_64, so that's a pretty recent ...
user avatar
  • 19.8k

Only top scored, non community-wiki answers of a minimum length are eligible