This project stands up dnsmasq inside docker inside virtualbox via vagrant, forwarding the following ports:
- localhost:60053/udp is forwarded to dnsmasq
- localhost:62375/tcp is forwarded to docker in the VM
- dnsmasq is configured by
vmfiles/dnsmasq-conf/dnsmasq.conf
- dnsmasq is configured (by default) to serve only the records included in
vmfiles/dnsmasq-conf/hosts
- clone this repo
cd
into the repo dirvagrant up
- This will take some time, more/less depending on your bandwidth and system. It takes about 90 seconds on my system.
- When it's finished,
dig @localhost -p60053 one
. echo '1.2.3.4 another.record' >> vmfiles/dnsmasq-conf/hosts
docker -H tcp://localhost:62375 kill -s HUP $(docker -H tcp://localhost:62375 ps -q)
dig @localhost -p60053 another.record