Help us understand the problem. What is going on with this article?

macでdnsmasq

More than 1 year has passed since last update.

やりたいこと

/etc/hostsにワイルドカードが書けないので、同じような挙動を実現したい。
*.example.com 192.168.0.1
をやりたい

Homebrewでインストール

brew install dnsmasq

設定

/usr/local/etc/dnsmasq.conf
に下記を追加
address=/example.com/192.168.0.1

sudo mkdir -p /etc/resolver
cd /etc/resolver/
sudo vi example.com
中身↓
nameserver 127.0.0.1

scutil --dns
で、

resolver #8
  domain   : example.com
  nameserver[0] : 127.0.0.1
  flags    : Request A records, Request AAAA records
  reach    : 0x00030002 (Reachable,Local Address,Directly Reachable Address)

があればOK

aat00000
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away