Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
# bash <(curl -s
# ----------------------
# installing dnsmasq and enable daemon
# ----------------------
brew install dnsmasq
sudo cp -v $(brew --prefix dnsmasq)/homebrew.mxcl.dnsmasq.plist /Library/LaunchDaemons
# ----------------------
# adding resolver for vbox domain
# ----------------------
[ -d /etc/resolver ] || sudo mkdir -v /etc/resolver
sudo bash -c 'echo "nameserver" > /etc/resolver/vbox'
# ----------------------
# configuring dnsmasq
# ----------------------
sudo mkdir -p $(brew --prefix)/etc/
cat > $(brew --prefix)/etc/dnsmasq.conf <<-EOF
# keep nameserver order of resolv.conf
# ----------------------
# launching dnsmasq
# ----------------------
sudo launchctl load -w /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist

This comment has been minimized.

Copy link

@simongcc simongcc commented Nov 28, 2018

I have tried this script and it works by adding .vbox to the Mac. Is this DNSMasq in the Mac can let other devices to access like mobile phone? What additional setup is required?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.