My current networking setup (on Arch Linux) involves:

  • stubby to resolve DNS requests with DNS-over-TLS.
  • dnsmasq to cache DNS queries (and nothing else).
  • openresolv to manage resolv.conf.
  • NetworkManager to set-up and tear-down network connections.

I have stubby listening on locahost on some random port, dnsmasq listening on localhost:53 and resolving DNS queries through stubby, and openresolv is set up to put localhost in resolv.conf and provide any other DNS entry (for example those obtained through DHCP by NetworkManager) to dnsmasq via separate configuration files:

# /etc/resolvconf.conf


However, at the moment those extra entries are being ignored.

What is the best way to use these entries only when connected to one of a few whitelisted networks?

To clarify, I know that with NetworkManager I can override the DNS entries provided over DHCP on a network-by-network basis, but what I would like to do is the opposite: use stubby by default and the DHCP entries for only one or two networks, as needed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.