-
-
Save simtabi/1aee948fc8c34881d3461f26cb06ea34 to your computer and use it in GitHub Desktop.
Revisions
-
ogrrd revised this gist
Oct 23, 2020 . 1 changed file with 51 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,53 @@ # Never touch your local /etc/hosts file in OS X again > To setup your computer to work with *.test domains, e.g. project.test, awesome.test and so on, without having to add to your hosts file each time. ## Requirements * [Homebrew](https://brew.sh/) * Mountain Lion -> High Sierra ## Install ``` brew install dnsmasq ``` ## Setup ### Create config directory ``` mkdir -pv $(brew --prefix)/etc/ ``` ### Setup *.test ``` echo 'address=/.test/127.0.0.1' >> $(brew --prefix)/etc/dnsmasq.conf ``` ### Change port for High Sierra ``` echo 'port=53' >> $(brew --prefix)/etc/dnsmasq.conf ``` ## Autostart - now and after reboot ``` sudo brew services start dnsmasq ``` ## Add to resolvers ### Create resolver directory ``` sudo mkdir -v /etc/resolver ``` ### Add your nameserver to resolvers ``` sudo bash -c 'echo "nameserver 127.0.0.1" > /etc/resolver/test' ``` ## Finished That's it! You can run scutil --dns to show all of your current resolvers, and you should see that all requests for a domain ending in .test will go to the DNS server at 127.0.0.1 ## N.B. never use .dev as a TLD for local dev work. .test is fine though. -
ogrrd revised this gist
Oct 23, 2020 . 1 changed file with 1 addition and 60 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,63 +2,4 @@ # NOTE this has been done properly by a guy here: https://www.stevenrombauts.be/2018/01/use-dnsmasq-instead-of-etc-hosts/ ## also never use .dev as a TLD for local dev work. -
ogrrd revised this gist
Dec 3, 2018 . 1 changed file with 5 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,8 @@ ## Never touch your local /etc/hosts file in OS X again # NOTE this has been done properly by a guy here: https://www.stevenrombauts.be/2018/01/use-dnsmasq-instead-of-etc-hosts/ ## You should go and do that now, ignore all of this. > To setup your computer to work with *.dev domains, e.g. project.dev, awesome.dev and so on, without having to add to your hosts file each time. -
ogrrd revised this gist
Aug 5, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -53,7 +53,7 @@ sudo bash -c 'echo "nameserver 127.0.0.1" > /etc/resolver/dev' ## Add local DNS to search order in System Preferences System Preferences > Network > Wi-Fi (or whatever you use) > Advanced... > DNS > add 127.0.0.1 to top of the list. ## Finished -
ogrrd revised this gist
Aug 5, 2013 . 1 changed file with 4 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -51,6 +51,10 @@ sudo mkdir -v /etc/resolver sudo bash -c 'echo "nameserver 127.0.0.1" > /etc/resolver/dev' ``` ## Add local DNS to search order in System Preferences System Preferences > Network > Wi-Fi (or whatever you use) > Advanced... > DNS > add 127.0.0.1 to top of the list ## Finished That's it! You can run scutil --dns to show all of your current resolvers, and you should see that all requests for a domain ending in .dev will go to the DNS server at 127.0.0.1 -
ogrrd revised this gist
Jul 23, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -25,7 +25,7 @@ mkdir -pv $(brew --prefix)/etc/ echo 'address=/.dev/127.0.0.1' > $(brew --prefix)/etc/dnsmasq.conf ``` You should probably add `strict-order` to `dnsmasq.conf` to keep nameserver order of `resolv.conf` ([see here](https://gist.github.com/drye/5387341)). ## Autostart -
ogrrd revised this gist
Jul 23, 2013 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -25,6 +25,8 @@ mkdir -pv $(brew --prefix)/etc/ echo 'address=/.dev/127.0.0.1' > $(brew --prefix)/etc/dnsmasq.conf ``` You should probably add `strict-order` to `dnsmasq.conf` to keep nameserver order of `resolv.conf` ## Autostart ### Work after reboot -
ogrrd renamed this gist
Jun 26, 2013 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
ogrrd renamed this gist
Jun 21, 2013 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
ogrrd renamed this gist
Jun 21, 2013 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
ogrrd revised this gist
Jun 21, 2013 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ # Never touch your local /etc/hosts file in OS X again > To setup your computer to work with *.dev domains, e.g. project.dev, awesome.dev and so on, without having to add to your hosts file each time. ## Requirements -
ogrrd revised this gist
Jun 21, 2013 . 1 changed file with 54 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1 +1,54 @@ # Never touch your local /etc/hosts file in OS X again > To setup your computer to work with *.dev domains, e.g. project.dev, awesome.dev and so on, without having to add to your hosts file each time ## Requirements * [Homebrew](http://mxcl.github.io/homebrew/) * Mountain Lion ## Install ``` brew install dnsmasq ``` ## Setup ### Create config directory ``` mkdir -pv $(brew --prefix)/etc/ ``` ### Setup *.dev ``` echo 'address=/.dev/127.0.0.1' > $(brew --prefix)/etc/dnsmasq.conf ``` ## Autostart ### Work after reboot ``` sudo cp -v $(brew --prefix dnsmasq)/homebrew.mxcl.dnsmasq.plist /Library/LaunchDaemons ``` ### Get it going right now ``` sudo launchctl load -w /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist ``` ## Add to resolvers ### Create resolver directory ``` sudo mkdir -v /etc/resolver ``` ### Add your nameserver to resolvers ``` sudo bash -c 'echo "nameserver 127.0.0.1" > /etc/resolver/dev' ``` ## Finished That's it! You can run scutil --dns to show all of your current resolvers, and you should see that all requests for a domain ending in .dev will go to the DNS server at 127.0.0.1 -
ogrrd created this gist
Jun 21, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ _