Created
August 3, 2009 20:53
-
-
Save luigi/160825 to your computer and use it in GitHub Desktop.
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 characters
# For Mac OS X users who don't want to manually add entries into /etc/hosts | |
# Stick these functions in your .bash_login or equivalent | |
# | |
# From the command line: | |
# $ add_localhost foo | |
# will create foo.local | |
# | |
# No error checking, so don't mess up... | |
function add_localhost { | |
sudo dscl localhost -create /Local/Default/Hosts/$1.local IPAddress 127.0.0.1 | |
} | |
function delete_localhost { | |
sudo dscl localhost -delete /Local/Default/Hosts/$1.local | |
} | |
function list_localhosts { | |
sudo dscl localhost -list /Local/Default/Hosts | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment