Skip to content

Instantly share code, notes, and snippets.

@tistaharahap
Created April 28, 2012 21:29
Show Gist options
  • Save tistaharahap/2522184 to your computer and use it in GitHub Desktop.
Save tistaharahap/2522184 to your computer and use it in GitHub Desktop.
DNSMasq Install & Configuration using Homebrew
# If you don't have Homebrew installed, you should. Do this.
/usr/bin/ruby -e "$(/usr/bin/curl -fksSL https://raw.github.com/mxcl/homebrew/master/Library/Contributions/install_homebrew.rb)"
# Install DNSMasq from Homebrew
brew install dnsmasq
# Create a directory for virtual hosts files
mkdir -p /usr/local/etc/dnsmasq.d
# Create a config for DNSMasq
vim /usr/local/etc/dnsmasq.conf
# Insert the following settings
server=8.8.8.8 # Public upstream DNS server 1 for non-local domains - Google
server=208.67.222.222 # Public upstream DNS server 2 for non-local domains - OpenDNS
server=208.67.220.220 # Public upstream DNS server 3 for non-local domains - OpenDNS
conf-dir=/usr/local/etc/dnsmasq.d # Put virtual hosts in a separate file/directory structure
# Start DNSMasq at bootup
sudo cp /usr/local/Cellar/dnsmasq/2.60/homebrew.mxcl.dnsmasq.plist /Library/LaunchDaemons
sudo launchctl load -w /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment