TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

dscl – The Easy Way to Add Hosts on OS X

1 pointsby gpantazesabout 2 years ago

1 comment

gpantazesabout 2 years ago
I noticed that the default &#x2F;etc&#x2F;hosts file has a comment saying not to alter the localhost.<p><pre><code> # localhost is used to configure the loopback interface # when the system is booting. Do not change this entry. ## 127.0.0.1 localhost </code></pre> It made me wonder what alternatives there were for adding additional hostnames for the loopback IP.<p>This article on dscl (<a href="https:&#x2F;&#x2F;tomafro.net&#x2F;2009&#x2F;07&#x2F;dscl-the-easy-way-to-add-hosts-on-osx" rel="nofollow">https:&#x2F;&#x2F;tomafro.net&#x2F;2009&#x2F;07&#x2F;dscl-the-easy-way-to-add-hosts-o...</a>) is one such finding.<p>If anybody has suggestions about the best way to add hostnames for testing&#x2F;override purposes, whether that&#x27;s &#x2F;etc&#x2F;hosts or something else, please comment with your favorite.