Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question
add comment

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 25 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
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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