dnsmasq
https://gyazo.com/2cd75082aa937c11d593ae7950db935b
DNSのフォワーダ+DHCPサーバー
インストール
$ brew install dnsmasq
設定の編集
指示通り
$ vi /usr/local/etc/dnsmasq.conf
code:/usr/local/etc/dnsmasq.conf
# Or which to listen on by address (remember to include 127.0.0.1 if
# you use this.)
listen-address=127.0.0.1
# (中略)
# Add domains which you want to force to an IP address here.
# The example below send any host in double-click.net to a local
# web-server.
address=/.test/127.0.0.1
.testドメインはローカルのDNSサーバーに問い合わせるようにする
/etc/resolver直下にtestを新規作成する
$ sudo vi /etc/resolver/test
code: /etc/resolver/test
nameserver 127.0.0.1
$ sudo vi /etc/resolver/test
起動
To have launchd start dnsmasq now and restart at startup:
$ sudo brew services start dnsmasq