Install dnsmasq on Mac OS X with homebrew

上月发现某203.208.46.xx IP用于代替一堆域名很不错。今天发现这个IP被屏蔽了。于是只能换一个。但是要改好多东西好麻烦。于是想到用dnsmasq的方式来玩。hosts表示好累。 首先安装Homebrew /usr/bin/ruby -e “$(curl -fsSL https://raw.github.com/gist/323731)” 安装成功后将配置文件模版复制到配置文件的位置: cp /usr/local/Cellar/dnsmasq/2.57/dnsmasq.conf.example /usr/local/etc/dnsmasq.conf 再配置一下自动启动: sudo cp /usr/local/Cellar/dnsmasq/2.57/uk.org.thekelleys.dnsmasq.plist /Library/LaunchDaemons sudo launchctl load -w /Library/LaunchDaemons/uk.org.thekelleys.dnsmasq.plist 然后修改上面的conf配置文件。修改网络连接的dns到127.0.0.1,而让dnsmasq去/usr/loca/etc/resolv.conf中找真正的DNS查询。这里/usr/local/etc/resolv.conf需要自信创建,并且告知配置文件。