Ubuntu 17.10, local DNS cache, and local name resolution

I’ve written this, deleted it, and rewritten this a few times over now. I’m going to just boil this down to something pretty simple.

Local name resolution has been broken out of the box in Ubuntu since Ubuntu started doing that whole local DNS caching bullshit. Preferably, I’d like to figure out how to work with their local caching system so that lookups are forwarded to the first DNS server provided by DHCP.

If that can’t be done, I need a reliable way to kill local DNS caching in 17.10. They changed it again. Used to be you would just remove an entry in network-manager’s configuration file. In more recent version, that entry doesn’t exist anymore, and instead you have to disable systemd-resolved. In 17.10, neither of those methods work.

Thoughts and opinions?

Are you saying you can’t specify an address in resolv.conf (and just write-protect it)?

1 Like

I was hoping to find a way to either work with whatever application is writing resolv.conf, or properly disable the application that is writing resolv.conf. But I could give this a shot and see if any problems arise from it.

Thinking on this a little more, this actually isn’t an option. If I take my machine elsewhere, like say I take my laptop somehwere, or take my desktop to a LAN party or something, then I need to manually edit resolv.conf to update the first nameserver entry so I’m not constantly trying to talk to a DNS server that doesn’t exist on the LAN I’m currently on.

It’s far better to just be able to use the DNS servers provided by DHCP dynamically.

Then you should remove the package that handles the caching and querying. Not familiar with Ubuntu but all my systems write the default entry in resolv.conf as, so ¿dhcpcd? writes the first DNS resolver it finds, and I have no caching process installed on end-devices.
My guess would be it’s dnsmasq. Check if you got it installed and if you do, remove it.

1 Like