Configuring Ubuntu 17.04 Network Manager to use dnsmasq (Properly)

By default the Network Manager configuration in Ubuntu 17.04 is configured to use systemd-resolv to configure dns. This is fine until you want to use a vpn that requires “internal” dns servers to resolve, for example a work vpn (like mine) which has dns resolving hosts to internal addresses, where as you get external addresses when not on the host network. See this post on configuring that.

Steps

  1. Install dnsmasq-base
    >sudo apt-get install dnsmasq-base
  2. Change Network Manager configurations.
    1. /etc/NetworkManager/NetworkManager.conf add “dns=dnsmasq” in the “main” section.[main]
      plugins=ifupdown,keyfile
      dns=dnsmasq

      [ifupdown]

      managed=false

    2. /etc/systemd/resolved.conf add “DNS=127.0.1.1” and “FallbackDNS=127.0.1.1”, also set “Domains” if you need to for local network resolution.[Resolve]
      DNS=127.0.1.1
      FallbackDNS=127.0.1.1
      Domains=fritz.box
  3. Reboot

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *