Ubuntu dnsmasq systemd-resolved High CPU04 Apr 2018
I am always about stability, but since I have 2 work laptops I thought of giving Ubuntu 18.04 (beta) a shot. I configured the machine to serve
.test domains using dnsmasq using a old blog post of mine. I then noticed the computer glitching. When I checked 2 processes were using nearly 100% CPU. This was not an issue with Ubuntu 16.04.
I had little luck following answers in StackOverflow and ServerFault. Then I thought of giving in my own solution.
My local network is simple. It has a WiFi router which is also an ADSL modem. It has DHCP enabled for any guests. But I use static IPs for my local computers, printers etc so I know the device by the IP. Thus I have manually configured network settings.
The idea is that the network manager to use localhost to resolve DNS queries which dnsmasq handle. dnsmasq will point
.test domains to localhost and query a configured dns server for other requests. I believe there will also be some caching in dnsmasq side that will speed up things.
- Set the DNS address for the network connection to 127.0.0.1 (localhost)
- Set the DNS address in dnsmasq to the router or a service you prefer
For the latter you would require to edit the
# Add other name servers here, with domain specs if they are for # non-public domains. # server=/localnet/192.168.0.1 server=192.168.1.1
Normally we would have few DNS addresses configured. In my case the router has been configured to have 2 DNS servers.
Your options for a DNS servers…
- Cloud Flare 126.96.36.199 (launched in April 1st 2018)
- Google 188.8.131.52, 184.108.40.206
There are many other DNS services.
After the update my computer is operating much smoother.