I prefer this method because it doesn't interfere with other DNS config you may have to do depending on the complexity of your environment (e.g. systemd-resolved).
For up-to-date instructions just follow the official docs.
sudo apt-get install dnsmasq
sudo systemctl restart dnsmasq
Add this configuration to a new dnsmasq config file:
vim /etc/dnsmasq.d/10-consul
Content:
# Enable forward lookup of the 'consul' domain:
server=/consul/127.0.0.1#8600