docker-compose up
On the right pane we can see how picobrew resolves to 137.117.17.70
if we don't specify a DNS server, but when we specify a DNS server of 127.0.0.1
(which points to our DNSMASQ cotainer), it resolves to 127.0.0.1
.
We'll need to update our local DNS to use our local server by default.
Head into your network preferences and add a DNS entry for 127.0.0.1.
And now we no longer need to specify our DNS server, picobrew.com just resolves to the value we specified in the dnsmasq.conf, and other address still work fine.
This will work fine if request are coming from your mac, but if requests are coming from another machine on your network (such as the picobrew), you'll need to tweak the dnsmasq.conf
file to point to the IP address of your mac on the network instead of 127.0.0.1
.
Tweak the below line in the dnsmasq.conf
file, replace 127.0.0.1
with the Network IP address of the machine running the docker containers.
address=/picobrew.com/127.0.0.1
If you bring down you local DNS server, you will no longer be able to resolve any DNS addresses, so go back to your system DNS settings, and remove 127.0.0.1
. That should restore your DNS to the value assigned by your local DHCP server.
I haven't been able to test if the .gitkeep
files cause issues. They are required to create the folder structure required, but if they cause issues we can probably add a setup script to rather create the files.