I'm trying to develop using subdomains on OSX but don't want to reboot the computer to refresh the hosts file. Normally on linux I'd do /etc/init.d/networking restart but I can't figure out how to do this on OSX.

link|improve this question

67% accept rate
feedback

migrated from stackoverflow.com Oct 14 '11 at 11:22

This question came from our site for professional and enthusiast programmers.

1 Answer

up vote 2 down vote accepted

You don't need to. Simply sudo vim /etc/hosts, change what you need to change and go on. Your changes will be applied instantly.

If ping yourdomain.com still gives you the wrong IP, try clearing your DNS cache:

dscacheutil -flushcache
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.