Skip to main content
Share Your Experience: Take the 2024 Developer Survey
91 votes

How to avoid conflicts between dnsmasq and systemd-resolved?

As of systemd 232 (released in 2017) you can edit /etc/systemd/resolved.conf (not /etc/resolv.conf) and add this line: DNSStubListener=no This will switch off binding to port 53. Make sure that the ...
Malvineous's user avatar
  • 6,923
45 votes

How to avoid conflicts between dnsmasq and systemd-resolved?

I just enabled option "bind-interfaces" by removing '#' at the start of the line in /etc/dnsmasq.conf. I was able to start dnsmasq again: dnsmasq bind DNS port on all interfaces (including
tomtom's user avatar
  • 451
31 votes

How to avoid conflicts between dnsmasq and systemd-resolved?

You can disable systemd-resolved from loading at boot using sudo systemctl disable systemd-resolved. If you want to run the two together, you can redirect the systemd-resolved to use the localhost as ...
Munir's user avatar
  • 3,352
19 votes

How to disable dnsmasq?

On Linux Mint, dnsmasq is installed to cache DNS queries, and thereby speed up your Internet experience. The first part of disabling it is to change the configuration in /etc/NetworkManager/...
jbo5112's user avatar
  • 330
17 votes

I can resolve a *.local domain, ping the IP, but I can't ping this domain

I found the answer! So most of you will know that the /etc/hosts file will resolve domains, somewhat like a DNS server. But how does the system know to look in that file? And how does it know what ...
DAB's user avatar
  • 475
15 votes

How to avoid conflicts between dnsmasq and systemd-resolved?

Here is solution for (X)Ubuntu 18.04 Bionic. Install dnsmasq sudo apt install dnsmasq Disable systemd-resolved listener on port 53 (do not touch /etc/systemd/resolved.conf, because it may be ...
sena's user avatar
  • 159
12 votes

How to measure DNS cache efficiency / cached items?

Another way to get this info from the man page: The cache statistics are also available in the DNS as answers to queries of class CHAOS and type TXT in domain bind. The domain names are cachesize....
NeroP's user avatar
  • 121
12 votes

Namespace management with ip netns (iproute2)

You have two questions in one: what are the empty files in /var/run/netns/? how to use /etc/netns/ which doesn't even exist? What are the empty files in /var/run/netns/? Some understanding of ...
A.B's user avatar
  • 37k
10 votes

How to avoid conflicts between dnsmasq and systemd-resolved?

Judging from the systemd manpages it's not intended being able to manually disable the stub DNS server. Interestingly I only noticed the described problem after upgrading systemd from 230 to 231. ...
freaker's user avatar
  • 414
10 votes

How to correctly disable systemd-resolved on port 53 for avoiding clash with dnsmasq in Ubuntu 20.04…?

By default, systemd-resolved provides a "validating DNS/DNSSEC stub resolver" on "IP address", port 53. You can verify this: $ sudo netstat -tulpn | grep LISTEN tcp ...
mainmachine's user avatar
10 votes

UFW blocks DHCP

sudo ufw allow bootps sudo ufw allow 53/udp sudo ufw allow 53/tcp
oscar's user avatar
  • 341
9 votes

How to assign multiple fixed ip address for one domain?

Okay, after nearly 10 years, the setting in the question post is now valid since dnsmasq 2.86 release. address=/ address=/ $ host chat....
jch's user avatar
  • 91
6 votes

resolving DNS via Tor

To minimize DNS leaks, it is indeed possible to resolve DNS via Tor. For that, add to your /etc/tor/torrc the line: DNSPort 9053 And restart the tor service with: service tor restart To test it ...
Rui F Ribeiro's user avatar
6 votes

Make dnsmasq not altering resolv.conf

dnsmasq itself is not altering resolv.conf If you have your configuration file and start it manually via dnsmasq -d -C <yourconfig> you see that. This behaviour comes from systemd unit on debian ...
Hannes's user avatar
  • 345
6 votes

Why does nslookup fail for DNS records set to a private address?

This is a feature of dnsmasq. The dnsmasq people call it "Rebind Protection". It defaults to being on. Either turn it off, or add the domain that you desire to work to the set of ...
JdeBP's user avatar
  • 69.2k
6 votes

dnsmasq not working after reboot

adding interface=eth0 to dnsmasq.conf as suggested by mosvy solved the issue.
RolandU's user avatar
  • 123
6 votes

dnsmasq dns nameserver priority parameters - strict-order

I too wanted to accomplish this. I have a router running dnsmasq and a PiHole. Raspberry Pi SD cards are prone to failure, so when DNS goes down, the internet is effectively down for everyone in my ...
371273's user avatar
  • 161
5 votes

How to reorder /etc/resolv.conf at load time

Yes, there is a simple way to do that. Add line to /etc/dhcp/dhclient.conf, example below, prepends DNS server to the resolver list. prepend domain-name-servers ; The prepend ...
steve's user avatar
  • 22k
5 votes

dnsmasq & systemd Causing Intermittent CPU Spikes

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

How do I set my DNS when resolv.conf is being overwritten?

Maybe I'm missing something, but according to the config instructions at all you do is update the following. I am not running a ...
TooIgnorantToNotBeAnonymous's user avatar
4 votes

How to avoid conflicts between dnsmasq and systemd-resolved?

There will be an option in systemd version 232 to disable the stub listener. See
Christoph's user avatar
  • 141
4 votes

How to avoid conflicts between dnsmasq and systemd-resolved?

I'm not sure why both services are trying to use the same address. Maybe you can arrange them as in my case on Xubuntu 18.04.1, where their configuration is the following: xy@zq:~$ sudo netstat -tulpn ...
JonnyTischbein's user avatar
4 votes

How to avoid conflicts between dnsmasq and systemd-resolved?

In my case (needing to provide a DNS service to other machines) I was able to solve the problem by telling dnsmasq to only bind to the ethernet interface (systemd-resolvd binds to loop-back) by ...
symcbean's user avatar
  • 5,649
4 votes

NetworkManager should ask only the "top" DNS server

If you don't want the DNS Server from the lan, configure on that WLan. You don't need a VPN to avoid the limited DNS server, just configure a static address like 'ipv4.dns='. ...
thaller's user avatar
  • 1,646
4 votes

Configure BIND and DNSMasq to work together on the same machine

According to bind9 documentation, the proper syntax is: forwarders { port 5353; }; As for using another IP, I'm not sure this is necessary, but I'd like to mention that you have plenty of ...
xhienne's user avatar
  • 17.9k
4 votes

How to Hide Dnsmasq version number?

I am not sure if there exists a configuration option to hide version.bind in dnsmasq, but there exists a compile time option NO_ID **Compile time option NO_ID** Some consider it good practice ...
Arushix's user avatar
  • 1,290
4 votes

How do I force dnsmasq to use a specific DNS server without affecting the host systems DNS settings?

To send specific dns addresses to the clients set server= server= in /etc/dnsmasq.conf. In this example and are google public dns.
jimmij's user avatar
  • 47.5k

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