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

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

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

1 Answer 1

up vote 37 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
For clearing dns cache, see: support.opendns.com/entries/… –  Romans-8---31-39 Sep 20 at 21:36
Make sure you obviously use the right order too (IP address, then DNS). –  user1442960 Dec 12 at 23:03

Your Answer


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.