Skip to content

Instantly share code, notes, and snippets.

@iegik
Last active May 29, 2019 08:56
Show Gist options
  • Select an option

  • Save iegik/c2483bb8fa37c1ff165f to your computer and use it in GitHub Desktop.

Select an option

Save iegik/c2483bb8fa37c1ff165f to your computer and use it in GitHub Desktop.

Install dnsmasq

brew install dnsmasq

Add mask

echo '/*.local.ru/*.local.ir/*.local.com/*.local.co.il/127.0.0.1' >> $(brew --prefix)/etc/dnsmasq.conf

Add to /etc/hosts

127.0.0.1 local.ru
127.0.0.1 local.com
127.0.0.1 local.ir
127.0.0.1 local.co.il

Add as service

sudo cp -v $(brew --prefix dnsmasq)/homebrew.mxcl.dnsmasq.plist /Library/LaunchDaemons

Lounch

sudo launchctl load -w /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist

Add local address to DNS in System Preferences (mac)

System Preferences > Network > Wi-Fi (or whatever you use) > Advanced... > DNS > add 127.0.0.1 to top of the list.

# hide network behind domain
address=/*.local.ru/*.local.ir/*.local.kz/*.local.co.il/127.0.0.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment