generic .dev or .test address for localhost in linux mint 19 with DNS masq

Linux Mint 19 generic DnsMasq localhost

Last year as a reminder for myself I created a small article for setting up DNS masq on linux mint 18.

After upgrading to Mint 19 (or actual reinstalling) I expected less or more the same steps.
But apparently some steps where a little different.

So here the steps to configure DNS masq on LinuxMint 19 for a generic local .dev or .test development extension.

  • Open /etc/dnsmasq.conf
  • If you don't have that file, you probably have to install dnsmasq: sudo apt install dnsmasq
  • Search for: #listen-address=
  • Change it to: listen-address=127.0.0.1
  • Search for: #address=/double-click.net/127.0.0.1
  • Change it to: address=/test/127.0.0.1
  • Save en close the file

Now we should like to change /etc/resolv.conf but that file is generated and will be overwritten when the computer restarts.
So instead we do:

  • Install resolvconf: sudo apt instal resolvconf
  • Open the file /etc/resolvconf/resolv.conf.d/head
  • Add here the line: nameserver 127.0.0.1
  • Apply the changes: sudo resolvconf -u

Now restart dnsmasq and we are done: sudo /etc/init.d/dnsmasq restart

To test we can run: nslookup some-domain.test
When the configuration is working you should at least get back the address line: Address: 127.0.0.1

Edit:
After restarting my computer, the internet failed. Apparently I had added my localhost for DNS but was missing the DNS for addresses on the internet. It was caused by having the nameserver 127.0.0.53 not enymore at the end of the /etc/resolv.conf file.
So to fix this:

  • Open the file /etc/resolvconf/resolv.conf.d/tail
  • Add here the line: nameserver 127.0.0.53
  • Apply the changes: sudo resolvconf -u