Edit hosts on a Mac OS X

Hosts files are located at /private/etc/.

Edit and add our new host configuration/ip.

sudo nano /private/etc/hosts


sudo nano /etc/hosts

Flush DNS cache

sudo dscacheutil -flushcache

This way we can have www.domain.com on a server for regular users and set up our own www.domain.com pointing to another server while we set up, for example, the migration.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.