Skip to content

Instantly share code, notes, and snippets.

@felipeelias
Created April 29, 2011 23:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save felipeelias/949197 to your computer and use it in GitHub Desktop.
Save felipeelias/949197 to your computer and use it in GitHub Desktop.
manage hosts in os x directory services
# list all registered hosts
dscl localhost -list /Local/Default/Hosts
# register a new host named "test.local"
dscl localhost -create /Local/Default/Hosts/test.local IPAddress 127.0.0.1
# remove the test.local host
dscl localhost -delete /Local/Default/Hosts/test.local
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment