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.

1 Answer 1


NetworkManager can create a custom zone per Wireless network see:


Section 9.2. Configuring a Wi-Fi connection using nmcli

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .