Techwetrust
Techwetrust is a programming blog maintained by Alin Alexandru, a young Python developer. He addresses topics like Python tutorials, Docker tutorials and other tech-related articles.

How to edit Mac OS hosts file?

What is the path of hosts file in Mac OS?

/private/etc/hosts

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.

127.0.0.1       mongodb
127.0.0.1       redis

Useful links

https://en.wikipedia.org/wiki/Hosts_(file)

Alin Alexandru

@skykery

Hello! My name is Banuta Alexandru Alin and I am working as a full-time programmer. I have experience in data mining, data science, and data parsing/crawling. I like to travel when I have some days off. May my knowledge help you and protect your way!

Leave a Reply