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需要自信创建,并且告知配置文件。

By Lu Jun

80后男,就职于软件行业。习于F*** GFW。人生48%时间陪同电子设备和互联网,美剧迷,高清视频狂热者,游戏菜鸟,长期谷粉,临时果粉,略知摄影。

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.