Tag Cloud
Concourse CI/CD devops prometheus kubernetes monitoring modbus kepware c-programming IoT golang telegram bot python cli urwid elasticsearch aws ecs apache spark scala AWS EMR hadoop webhooks ssl nginx digital-ocean emr apache pig datapipeline found.io elastic-cloud rails try capybara docker capistrano heka bigquery kafka protobuf vim iterm javascript emberjs git scripting dnsmasq bem frontend meteorjs meteorite heroku

Dnsmasq for Local Dev

I work for Wego (hotels/flights metasearch) and we’ve got many sites for the various cctlds. To test them after frontend development, usually I’ll just add like www.wego.com.sg to my host file and direct it to 127.0.0.1 but sometimes it gets a little troublesome, especially when the autocomplete forms breaks from www.wego.com.sg without the 3000 port.

I found this little gem the other day to help me deal with that. It basically helps me to just add .dev behind any domain and it’ll automatically be redirected back to 127.0.0.1; a real life-saver!

brew install dnsmasq

mkdir -pv $(brew --prefix)/etc/

echo 'address=/.dev/127.0.0.1' > $(brew --prefix)/etc/dnsmasq.conf

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

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

sudo mkdir -v /etc/resolver

sudo bash -c 'echo "nameserver 127.0.0.1" > /etc/resolver/dev'

comments powered by Disqus