Skip to content

Instantly share code, notes, and snippets.

@nnsee
Last active January 18, 2022 11:14
Show Gist options
  • Save nnsee/6c4f67eb247b983910d69bb71bc3537f to your computer and use it in GitHub Desktop.
Save nnsee/6c4f67eb247b983910d69bb71bc3537f to your computer and use it in GitHub Desktop.
Get dnsmasq to work properly with NetworkManager, VPNs, etc using openresolv

/etc/dnsmasq.conf:

listen-address=::1,127.0.0.1
interface=lo
conf-dir=/etc/dnsmasq.d
bind-interfaces

/etc/dnsmasq.d/openresolv.conf:

conf-file=/etc/dnsmasq-conf.conf
resolv-file=/etc/dnsmasq-resolv.conf

Default nameservers, if any, can go in /etc/dnsmasq.d/default.conf:

server=1.1.1.1
server=1.0.0.1

/etc/NetworkManager/NetworkManager.conf:

[main]
rc-manager=resolvconf

Run resolvconf -u once to generate config files. Restart all services.

/etc/resolv.conf should then look like the following:

# Generated by resolvconf
search sif.ee
nameserver ::1
nameserver 127.0.0.1
options trust-ad
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment