Make all *.local domains resolve to localhost

It’s time for my yearly blog post, so let’s get started! Some development environments use *.local-domains which point to localhost. Creating a hosts-entry for every single domain is not an elegant solution, so let’s do something easier: let’s use dnsmasq to resolve ALL .local-domains to localhost! Tested on CentOS 7, but should work similarly for other Linuxes. All commands assume you have root privileges. If you are not logged in as root, prepend sudo to all commands.