diff --git a/README.md b/README.md index 9b4ce81..7173c47 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ variety of languages and technologies. These are things that don't really warrant a full blog post. These are mostly things I learn by pairing with smart people at [Hashrocket](http://hashrocket.com/). -_477 TILs and counting..._ +_478 TILs and counting..._ --- @@ -433,6 +433,7 @@ _477 TILs and counting..._ - [List Names Of Files With Matches](unix/list-names-of-files-with-matches.md) - [List Of Sessions To A Machine](unix/list-of-sessions-to-a-machine.md) - [List Parent pid With ps](unix/list-parent-pid-with-ps.md) +- [Map A Domain To localhost](unix/map-a-domain-to-localhost.md) - [Only Show The Matches](unix/only-show-the-matches.md) - [Open The Current Command In An Editor](unix/open-the-current-command-in-an-editor.md) - [Partial String Matching In Bash Scripts](unix/partial-string-matching-in-bash-scripts.md) diff --git a/unix/map-a-domain-to-localhost.md b/unix/map-a-domain-to-localhost.md new file mode 100644 index 0000000..6126e2b --- /dev/null +++ b/unix/map-a-domain-to-localhost.md @@ -0,0 +1,15 @@ +# Map A Domain To localhost + +Do you want your computer to treat a domain as `localhost`? You can map it +as such in your `/etc/hosts` file. For example, if I have an web app that +refers to itself with the `dev.app.com` domain, I can add the following line +to my `/etc/hosts` file to make sure the domain resolves to `localhost`: + +``` +127.0.0.1 dev.app.com +``` + +Now, if I pop open my browser and visit `dev.app.com:3000`, I will see +whatever is being served to `localhost:3000`. + +h/t Chris Erin