Menu Close

How to edit Mac OS hosts file?

techwetrust post image

What is the path of hosts file in Mac OS?


How to open for editing the hosts file in Mac OS?

Using nano:

sudo nano /private/etc/hosts

Using vim:

sudo vim /private/etc/hosts

How to edit the hosts file?

You can modify your hosts file in order to change the domain name system (DNS) for a domain on your computer.

What does this mean? You can make simple aliases point to your services. For example, I’m using my hosts file to resolve my local services.       mongodb       redis

Useful links

Spread the love

Leave a Reply